Does anybody know how I can execute a .sql file from within solution explorer in VS 2008 Professional?
I know you can do this开发者_如何学JAVA in VS 2005 but cannot find this feature in VS 2008 professional
If it's within a database project, then you can right click on it and choose "Run" or "Run On...".
Use the "Server Explorer" (Ctrl+W, L) to add a connection, then once a connection is open you can right-click the server node and select "New Query". This will allow you to paste in the contents of an SQL file.
Alternatively open the SQL file, then from the "T-SQL Editor" toolbar you can choose "Connect" from your saved connections, and then select the database in the drop-down box.
According to this link you go to menu Data->Transact-SQL Editor->New Query Connection I think you can figure out the rest by yourselves.
精彩评论