Execute a sql script inside visual studio 2012

4.3k views Asked by At

I have a script generated by ado.net entity model after changing the database. i need to execute this script inside visual studio 2012. This MSDN link was not of any help

2

There are 2 answers

0
Nikitesh On BEST ANSWER

Used schema compare tool for VS 2012. This not only created a script for me but also updated the production database to exact copy of development database. Here is the link

2
Panagiotis Kanavos On

The link you posted concerns database project scripts, not running ad-hoc queries.

To run an ad-hoq query, you can add a connection to the database in Server Explorer, then select "New Query" from the database's context menu.

You can also use SQL Server Object Explorer to add a connection to a specific server, view all databases and execute ad-hoc queries. This is a more powerful feature, almost as powerful as using SSMS itself.