简体   繁体   中英

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". From there I can run .sql files, by right-clicking them, like this:

db项目 -  vs2008解决方案


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.

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?


Edit A fellow coworker also has this same issue: How to create a database project in Visual Studio 2013


Edit2 Tried this from msdn: How to: Run SQL Scripts in Solution Explorer , but no success. 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

When you create a new Project, do you have the "SQL Server Database Project" available?

Have you tried the solution in this post ?

在此输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM