[英]How to run sql script from the solution explorer in Visual Studio 2013 or 2010
I have a Visual Studio 2008 solution containing a "database project". 我有一个包含“数据库项目”的Visual Studio 2008解决方案。 From there I can run .sql files, by right-clicking them, like this: 从那里我可以运行.sql文件,通过右键单击它们,如下所示:
However, I imported this project to both Visual Studio 2010 (resulting in a .dbproj
file) and VS2013 (ending .sqlproj
file), and now I cannot find that option anymore. 但是,我将此项目导入Visual Studio 2010(生成.dbproj
文件)和VS2013(结束.sqlproj
文件),现在我再也找不到该选项了。
Also, I can't figure out how to add a database reference to my production server, just like I used to do. 此外,我无法弄清楚如何将数据库引用添加到我的生产服务器,就像我以前一样。
I did try to create a new project in these newer versions as well, but no good. 我确实试图在这些较新的版本中创建一个新项目,但没有好处。
So, two questions. 那么,有两个问题。 First, how to add my db reference, and second, how to run the .sql script under that reference? 首先,如何添加我的数据库引用,第二,如何在该引用下运行.sql脚本?
Edit A fellow coworker also has this same issue: How to create a database project in Visual Studio 2013 编辑同事也有同样的问题: 如何在Visual Studio 2013中创建数据库项目
Edit2 Tried this from msdn: How to: Run SQL Scripts in Solution Explorer , but no success. Edit2尝试从msdn: 如何:在解决方案资源管理器中运行SQL脚本 ,但没有成功。 The "Run" and "Run On" options aren't there, and dragging the script to the database reference didn't work as well. “运行”和“运行”选项不存在,将脚本拖动到数据库引用也不起作用。
Also found the following related question: visual studio extension to execute sql 还发现了以下相关问题: visual studio扩展执行sql
When you create a new Project, do you have the "SQL Server Database Project" available? 创建新项目时,您是否有“SQL Server数据库项目”?
Have you tried the solution in this post ? 你在这篇文章中试过这个解决方案吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.