Open File in current query window in Management Studio?

  • In SQL Server Management Studio with a query already open...

    How can I make it so that when I open another file it opens in the current query window/tab rather than a new one forcing me to make another connection?  Basically I'd like it to work like QA did.

    Thanks much

    Carl

  • This was removed by the editor as SPAM

  • That is exactly how it does work. What version are you using?

  • I'm using Dev Edition Sept CTP.  I just checked again and it is working as I stated.  I guess if it works the way I want it to for you that is at least hope

  • Well, I am using Dev Edition Sept CTP as well. So I guess we are not doing things exactly the same.

  • Here are the things I've done...

    1) menu file, open, file, and open a file.  Repeat and a second window will open.

    2) basically same thing using the "open file" tool bar icon and get the same results.

    I've looked through the options and customize under tools but couldn't find anything that would change the way it works.

    Thanks

    Carl

  • Aha. Yes, with Open File it seems that you get a Connect dialog every time. However if you press Ctrl+N, or New Query, then that will open a new empty window in the server and database that you are connected to.

  • If I'm working with a bunch of items I don't want a new tab for item I open.  I want it to open in the query tab I already have open.  So it basically sounds like if I want to open an existing sql file I have to make the connection because it will open a new file.  That sucks!  I wish they could either change it or make it configurable in the final release.

  • Has anyone found a work-around to this problem yet? I'm frustrated by the same behavior as Carl:

    I open a query against a database and do something trivial like SELECT COUNT(*) FROM Table1. Then I want to open a file so I click on the Open File icon (or menu option). After selecting the file, I'm forced to open another connection to the database. I'd rather just reuse the existing connection/tab.

    This unwanted behavior has kept me going back to Query Analyzer. I, too, have looked through the options and have not seen anything to suggest it is configurable.

    Thanks for any insight.

    Phillip

  • Hi,

    I finally decided to make it standard to have the USE statement as the first line of any programmability object.  Probably should have done this before since our programmers also have access to put DB objects into production.  That has been a big help but it still does not fix the problem of wanting to do a quick query of some type.

    Couple of changes that could help out.   Defualt to the current selected DB in Management Studio or selected DB for the active query window OR use the current functionality of code snippets in Visual Studio.

  • If you have a Query window open and select insert file as text under the Edit drop down it will drop the text(from a .sql) file into the existing window.

    Thanks..

    Rich

  • Cool.  That helps.... basically code snippets.

  • If I understand your issue properly .

    Go to the Tools /option Menu

    Under the Environment Tab

    There is a drop down box for At Startup

    Choose Open new query Window drop down

    Instead of the default Open Object Explorer

    This worked for me

Viewing 13 posts - 1 through 12 (of 12 total)

You must be logged in to reply to this topic. Login to reply