visual-studio 在 Visual Studio 中运行 SQL 脚本
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2726229/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Run SQL script inside Visual Studio
提问by burntsugar
I have a scripted database SQL file that I need to execute insideVisual Studio to create a new database. I am so far unable to locate any function that allows me to do this.
我有一个脚本化的数据库 SQL 文件,需要在Visual Studio 中执行以创建新数据库。到目前为止,我无法找到任何允许我执行此操作的功能。
回答by Raj Kaimal
Go to server explorer in VS, right click on server and select run query.
转到 VS 中的服务器资源管理器,右键单击服务器并选择运行查询。
Do you mind telling us why it has to be run inside VS?
你介意告诉我们为什么它必须在 VS 中运行吗?
In addition, the database projects offers a lot of features that are worth looking at:
此外,数据库项目提供了很多值得关注的特性:
http://www.informit.com/articles/article.aspx?p=31764//old article but still worth reading.
http://www.informit.com/articles/article.aspx?p=31764//旧文章但仍然值得一读。
http://www.emadibrahim.com/2008/07/10/database-schema-compare-upgrade/
http://www.emadibrahim.com/2008/07/10/database-schema-compare-upgrade/
回答by DaviddO Hige
There is a green arrow of play on the upper left corner of the window query. And down the tabs of the names of open files in VS. Just click to play and ready.
窗口查询的左上角有一个绿色的播放箭头。并在 VS 中打开文件名称的选项卡。只需单击即可播放并准备就绪。

