Sunday, December 11, 2011 4:48 PM
I'm using the Microsoft SQL Server Management Studio in Denali and having problems with the Object Explorer. When I load a bunch of tSQL files their connection bears no relationship to the connection(s) visible in the Object Explorer and so I'm often running a query thinking it's on the database I can see listed, while in fact it runs on another database. As you can imagine that is frustrating. Are there any settings I can use to ensure that the current query's active connection is somehow indicated in the Object Explorer?
Sunday, December 11, 2011 8:06 PM
Object Explorer uses a different connection from the Query Editor, and there is no reason to assume that they have any relation. However, there is a drop-down on the top of Object Explorer which indicates the current database for the current query window. You can also see the database name on the tab, although the text on the tab is typically abbreviated, unless you customise the tabs to not show all elements.
However, if you right-click a database in Object Explorer and select New Query, the query window will open in that database.
Erland Sommarskog, SQL Server MVP, firstname.lastname@example.org
Sunday, December 11, 2011 8:12 PMThanks Erland, I was aware of the drop-down and the new query, but the tab settings sound useful. I think this'll be a problem for me. When I'm immersed in a problem it's hard to remember to check which database I'm on when it is buried deeper than other more visible databases in the UI.