How to easily point a script from one server/Console/DataSource to another - like Dev and then Test

I couldn't find anyone else asking this question, which seems odd. Maybe my workflow is not intended.

I often work on a report, query or script against one server (say a Dev instance) and then when I'm happy with it I execute it against a test server or wherever the latest schema or data is.

When I open a file (from the files tab) and execute for the first time, I am prompted to 'Choose Console' with a list of the open connections (consoles) or an option to create a new console/connection against a target server/DataSource.

But how do I change the target of my file/script/query from one console to another? Like, from the Dev server to Test?

This is also useful if I want to use some laboriously-created temp tables belonging to another connection/console.

Grateful for any help or advice!


I ran into this exact same problem and it took me forever to figure out that in the lower right hand part of the window, there was a drop down selector that showed the different connections I had available.  I was able to change it and then run against a different connection.  You can also select <detach> and it will prompt you the next time you try to run from that SQL file.


They really need to document this and put it somewhere everyone can see. Anyone who is working in DEV/UAT/PROD DB environments is going to need this all the time.


Back from vacation - thanks for the tip! That's exactly what I was looking for.


Please sign in to leave a comment.