Change the database for a new query window opened

Issue #60 new
Maxim Novikov created an issue

When you find something in HD's window and choose, say, "Select", the add-in opens a new query window (with "USE" statement in it) but not change the database for that window. It's kinda annoying.

Comments (13)

  1. alex empty

    I know it is - but it is not because I am lazy or something. It is because I didn't find a way to hack SQL Studio to force ti to change connection...

  2. Maxim Novikov reporter

    You have a method in ManagementStudioController class - CreateSQLDocument. There you create a new document (I suspect it's about opening a query window), where you call CreateNewBlankScript supplying UIConnectionInfo object (http://technet.microsoft.com/en-us/library/microsoft.sqlserver.management.smo.regsvrenum.uiconnectioninfo_properties.aspx). You can probably set the database using AdvancedOptions property ("DATABASE"). (http://technet.microsoft.com/en-us/library/microsoft.sqlserver.management.smo.regsvrenum.uiconnectioninfo.advancedoptions.aspx)

  3. Log in to comment