How to run sql script from the solution explorer in Visual Studio 2013 or 2010

+5 votes
asked May 16, 2015 by first-timer

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 project - vs2008 solution


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.

enter image description here

Also found the following related question: visual studio extension to execute sql

1 Answer

0 votes
answered Jun 30, 2015 by karmaedv

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

Have you tried the solution in this post?

enter image description here

Welcome to Q&A, where you can ask questions and receive answers from other members of the community.
Website Online Counter

...