Steps to Reproduce:
Connect to a database and open a New Query window.
Drag a .sql file into the studio. The file opens in a tab that needs to establish a connection before executing. It would be a great feature if we could drag a file into the workspace or onto a server and have it open in a tab with the connection already established (like in SSMS).
The same is true with opening files from the Studio's Explorer pane.
Would be great to have this. Annoying to have to keep re-opening the same connection.
@erickangMSFT you had some concerns with this feature when we discussed during triage. Could you please add some detail here regarding your thinking? Perhaps this could be a user setting?
I vote for this feature, too. If you are working with multiple files on same database, it's really annoying, when you have to choose connection with every file. It could be user setting.
IT would be great to have both options:
This is crucial when working with multiple files. When a file is opened it should use the connection associated with the active query window. This feature is a great time saver when working with multiple scripts associated with a database. That's how it works with SSMS so I keep going back to it when I have to work with multiple files.
This is a critical feature, for instance when running update patches. I find it especially important when using the explorer view. The easiest solution could be simply to right click a server and select "Set as default connection". Neone-pl's workspace idea is also interesting.
sqlopsstudio is great but whenever you have to use SMS instead, because there is no way around the problem, it is just not good enough.
When opening SQL files using Open File Dialog or drag-and-drop, ADS will try to connect the editor to the "current global connection." The global connection is based on the current focused region in the application (e.g. active editor or node selected in Object Explorer, etc).
If you're seeing cases where the opened editor is not being correctly connected could you please open an issue with the specific repro steps include what is the currently focused elements in the UI so we can resolve the bug in the global connection tracking code. Thanks!
Most helpful comment
IT would be great to have both options: