- First connect to a server
- Open a new query
- And now click on “Query” menu.
- Choose “SQL CMD Mode”
Once you click on “SQL CMD Mode”, the query editor will go into command line mode.
Now type :Connect ServerName. This command will establish a connection to the server you have specified and then it will execute your query on that server.
Now if you go to “Messages” Tab, you will see the below result text (self explanatory).