in Microsoft SQL Server Management Studio, I use File -> Open -> File (Ctrl + o)
to open a开发者_如何学JAVA .sql script, which includes a list of select statements. However, when I try to run them it complains that it's not connected to any server. What should I do?
Usually I right click a server in the Object Explorer panel (to the left) and select New Query
. But that will open a new tab. In theory I could then copy-paste the codes from the previously opened .sql file to the new tab. But that's not what I'm looking for.
Thx!
There are several ways to get there. One is to right-click inside the query window, then choose Connection -> Change Connection...
File -> Open -> File with New Connection is one way
精彩评论