开发者

How do I run an arbitrary SQLite query from Visual Studio?

I can't believe this is the first time this has come up. I have a script that looks like this:

drop table if exists Recipients

drop table if exists Messages

create table Recipients (
    Id INTEGER not null,
   Name TEXT,
   Email TEXT,
   primary key (Id)
)

create table Messages (
    Id INTEGER not null,
   Subject TEXT,
   Contents TEXT,
   SentOn DATETIME,
   primary ke开发者_如何学运维y (Id)
)

and I just want to run it against a SQLite connection in my server explorer but the only way I can find of executing SQL is against the silly query builder.

I don't need a visual anything. I just need a pad that I can hit "Execute" on and it will run the script.


sqlite3 filename.db < input.sql


Not sure about SQLite, but for SQL Express connection you can right-click on the server node in Data Connections in Server Explorer and choose "New Query". Then you can paste in your query and click the red ! button to run it.

Even though the query builder might show up, one of the panes allows you to type in any query you want. If that pane doesn't show up, right click anywhere in the query builder, choose Pane, and make sure that "SQL" is enabled.


I use http://sqliteadmin.orbmu2k.de/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜