Same editor tab query window but able to disconnect one server and connect another?

  • Hello,

    This is not something earth shattering, but it is something that I thought I would put out to those that know SQL Server a lot better than me. I'm using SSMS in SQL Server 2008. I referring to the tabbed sql editor window.

    I have some TSQL that I need to run on various servers. It easy to just cut from one window, connect a server, open an editor window for that server and past the code.

    I was just wondering if there is a faster way. Can you keep the same editor window open and just point it to a specific server?

    I've got a lot of servers to check on and run some code and it would be easier to just keep the same editor window open and run the same code on all my servers. This is instead of opening a query tab, run some code, copy the code, connect to the next server, open another query tab and past and run the code.

    Nothing earth shattering. Just looking for any shortcuts that I can find.

    Thanks.

    Things will work out.  Get back up, change some parameters and recode.

  • You can right click on any place on the query pane. In the popup menu click on “connection..”, and then select “change connection…”.

    Adi

    --------------------------------------------------------------
    To know how to ask questions and increase the chances of getting asnwers:
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    For better answers on performance questions, click on the following...
    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

  • Sweet!!!!!

    See what I get for just asking. Even though I thought it might be considered a dumb question, I thought I would ask anyway. I'm glad I did.

    Thanks.

    Things will work out.  Get back up, change some parameters and recode.

  • Running the same code on multiple servers one by one is so slow. Since you're on SQL2008, run the code on all servers with one execution. 😀

    p.s. 2008 Management studio required, not 2008 database server

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • This should work out good also... http://msdn.microsoft.com/en-us/library/bb964743.aspx

    Wayne
    Microsoft Certified Master: SQL Server 2008
    Author - SQL Server T-SQL Recipes


    If you can't explain to another person how the code that you're copying from the internet works, then DON'T USE IT on a production system! After all, you will be the one supporting it!
    Links:
    For better assistance in answering your questions
    Performance Problems
    Common date/time routines
    Understanding and Using APPLY Part 1 & Part 2

  • To quote a friend of mine, "I'm like WOW"

    I am so glad I asked the question. I did not know about the Central Management servers. That is so cool. I can even create sub folders for Production 2008, Production 2005 and Production 2000. I can then run the appropriate command against each group. That is so nice.

    Thank you guys for letting me know that. I just grew in my DBA career.

    Things will work out.  Get back up, change some parameters and recode.

  • WebTechie38 (9/7/2010)


    I did not know about the Central Management servers.

    What I showed isn't central management servers. It's just multi-server queries. Central management servers are something else entirely.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Gail,

    Thanks for showing me that. That was a big help!

    Tony

    Things will work out.  Get back up, change some parameters and recode.

Viewing 8 posts - 1 through 7 (of 7 total)

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