SSMS Tips and Tricks 4-3: Changing connections in a query window
I commonly run into a few connection-related scenarios:
- I’m working on a large query and need to run it against several servers, not concurrently, but one after the other.
- I’ve just made a database connection, and got my query ready, only to discover that I’ve connected to the wrong server.
Either way, what I’ve seen people do in these scenarios is to:
- Select all the text in the current query
- Copy it
- Open a new query window
- Paste the code
That’s all good but SSMS has had a simpler way of doing this for quite a while.
2025-08-03