SSMS Trama (yes, this is really bugging me)

  • In Tools -> Options -> General, I have "At Startup" set to Open Empty Environment. This works wonderfully with 2k5, as it has no summary window and I have to go into Object Explorer to open my databases. Also, it forces me to choose which environment to open new queries in each time.

    Unfortunately, SQL 2k8 isn't working that way. I get a blank Object Explorer Details screen (I don't want this to show up unless I call it) and it auto-opens queries to the last used query screen (which I REALLY don't want, especially if I had a production window open as the last query screen).

    Does anyone know what I need to do in order to force it to do my expected behavior? I really don't want to inadvertently run Dev code in a Prod connection. That Would Be Bad.

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

  • I can't get it to do precisely what you're describing.

    I do get the empty Object Explorer, but I don't get any scripts/connections re-opening. Am I misunderstanding what you mean about queries re-opening?

    Have you tried setting the Auto Hide option on Object Explorer? Does that give you what you want?

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • Gus,

    The first time I open up a script, SSMS will ask me to pick a server connection. But each time after that, it will not. It will auto-connect to the server that I last opened a connection to. I don't want it to auto-connect. I want to force SSMS to ask me each time I open a script which server to use.

    Does that make sense?

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

  • Ah! I get it now.

    No, there doesn't appear to be an option for that. The closest would be under Query Execution options, "Disconnect after the query executes".

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • GSquared (7/5/2011)


    No, there doesn't appear to be an option for that. The closest would be under Query Execution options, "Disconnect after the query executes".

    Which isn't what I want.

    Darnit.

    Thanks for double-checking.

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

  • Brandie Tarvin (7/5/2011)


    GSquared (7/5/2011)


    No, there doesn't appear to be an option for that. The closest would be under Query Execution options, "Disconnect after the query executes".

    Which isn't what I want.

    Darnit.

    Thanks for double-checking.

    Brandie,

    In the File menu in SSMS 2008 R2 there is an option under Open -> File with New Connection and File Disconnected.

    Granted, this does not allow you to double-click to open a file and then login or drag and drop, but it is an option. Unfortunately, there is not a shortcut for this one, but I think that it could be added to the toolbar.

    Regards, Irish 

  • Jeffrey Irish (7/5/2011)


    In the File menu in SSMS 2008 R2 there is an option under Open -> File with New Connection and File Disconnected.

    I've got regular 2k8 at work, not R2.

    Thanks, anyway.

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

  • The first time I open up a script, SSMS will ask me to pick a server connection. But each time after that, it will not. It will auto-connect to the server that I last opened a connection to. I don't want it to auto-connect. I want to force SSMS to ask me each time I open a script which server to use.

    Seems like odd behavior but when I open a new query using "Database Engine Query" instead of "New Query" all subsequent .sql file I open ask for database connection until I restart SSMS.

    Bob
    -----------------------------------------------------------------------------
    How to post to get the best help[/url]

  • Bob,

    Aha. That does work for new queries. Thanks.

    I'm still trying to figure out a way to open up my saved queries, though, without having SSMS auto-connect them. Any thoughts?

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

  • not quite sure what you mean by "saved queries".

    Bob
    -----------------------------------------------------------------------------
    How to post to get the best help[/url]

  • Robert klimes (7/5/2011)


    not quite sure what you mean by "saved queries".

    .sql files on the hd.

  • I know this isn't a solution - but there are two buttons next to the database drop-down to connect/disconnect or change connection.

    After dragging the file, or double-clicking a sql file - the first thing I do is hit the change connection button and set the right connection.

    There is another way to work this, but it takes a bit more to set up. You can use the Solution Explorer and build projects. The files saved in the project can have the connection information saved with them. That way, when you open the file from the project - it will open with the saved connection information.

    Jeffrey Williams
    “We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”

    ― Charles R. Swindoll

    How to post questions to get better answers faster
    Managing Transaction Logs

  • Ninja's_RGR'us (7/5/2011)


    Robert klimes (7/5/2011)


    not quite sure what you mean by "saved queries".

    .sql files on the hd.

    If this is the case than opening any connection with "Database Engine Query" will result in all .sql files asking for a connection when opening them.

    Bob
    -----------------------------------------------------------------------------
    How to post to get the best help[/url]

  • It might be "overkill" for your scenario but if you use projects to store your .sql files, you can specify the connection in the solution.

    You could then have separate solutions for different connections...

    http://msdn.microsoft.com/en-us/library/ms174161.aspx

    gsc_dba

  • Jeffrey, I know I can change connections after bringing things up, but I tend to have so much going on at once that I don't always remember to do that (I usually have multiple copies of SSMS open). Hence the reason I want it to ask me up front.

    As far as multiple projects go, that's a little impractical for the number of servers / instances we're currently working with. That means I'd have to save the queries at least 5 or 6 times over. It would chew into my available disk space as well as having to keep everything current with each other.

    At this point, I'm just going to have to change my SSMS habits.

    ...And complain to Microsoft for not giving me the option I want. @=)

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

Viewing 15 posts - 1 through 15 (of 29 total)

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