How can I have SQL Server Management Studio 2008 connect to my instances automatically?
Solution 1:
I just discovered it this evening, so let me share my joy: Registered Servers are still available in SQL Server Management Studio!
In the View menu, choose Registered Servers. That will open the window for them. Then, drag that window to the side to dock it.
Along the top of the window you'll see icons for the types of servers (SQL, SSAS, SSIS, SSRS). Choose the type you're registering.
Add your instances to the Local Server Groups by right-clicking and selecting New Server Registration, then complete configuration for the connection.
Once that's done, you can double-click on a server to open the Object Explorer for that server.
Solution 2:
OK, so this is what I did (I'd like to edit the accepted answer because I based this on his idea, but I don't have enough points...)
- I set SSMS to start with "an empty environment", so it doesn't prompt me for a login (Tools-> Options->Environment->Startup).
- I opened Object Explorer and docked it to the left
- I opened Registered Servers and made it a "Tabbed Document" instead of a "Dockable" window.
- In the middle pane, I opened Registered Servers and Object Explorer Details, which SSMS apparently remembers from session to session.
So now when I get in, I have the list of my servers right there and I can connect with a few clicks. It's not perfect, but it's close enough that i'll stop fighting it :-)
Thank you sphilp!
Solution 3:
Here you will find information on how to start the SQL Server Management Studio (SSMS) from a shortcut or from the command line.
The following will open the SSMS by using Windows Authentication and will bypass the splash screen. The query editor will be set to the SMS_XXX database:
For SQL Server 2005 Management Studio (sqlwb.exe
):
sqlwb -E -S <serverName> -d <databaseName> –NoSplash
For SQL Server 2008 Management Studio and later, including 2016, ssms.exe
):
ssms -E -S <serverName> -d <databaseName> –NoSplash
You don't need to specify the -d <databaseName>
argument - and in SQL Server 2016 Management Studio (at least) it will connect both Object Explorer and create a new Query document connected to the same server instance.
Note: Change SQLServerName as needed.
SqlWb Arguments:
SqlWb (Options) Scriptfile Specifies one or more script files to open. Projectfile Specifies a script project to open. Solutionfile Specifies a solution to open.
-S Server Name -d Database Name -U Username -P Password -E Windows Authentication (as opposed to the -U and -P options) -Nosplash Bypasses the splash screen -? Help
Referenced from: http://myitforum.com/cs2/blogs/dhite/archive/2008/05/26/opening-the-sql-server-management-studio-from-the-command-line.aspx
I don't think you will be able to automate the 3 connections. But you could create linked servers so that you connect to 1 and link to the other 2
Solution 4:
I tried adding additional info to the answer by sphilp but that edit got rejected because some people seem to think it's incorrect. I can assure you: it is not.
What I wanted to add:
The Registered Servers functionality in SSMS can be used to connect to several servers in just a couple of clicks. If you group the servers together by creating a New Server Group under the Local Server Groups node, you'll be able to right-click that group and select Object Explorer. This will open all servers in ... Object Explorer!
More details: SSMS: Connect To Several Servers In One Click (Okay, Two)
You can even influence the order in which the connections are opened (alphabetically).