SQL Server Management Studio provides you the option of launching from command line. If you want to launch SSMS with a New Query Window and Object Explorer using command line, then you need to do the following changes.
Tools –> Options will open up the Options page for SSMS.
Under that you would see an At Startup property under Environment –> General. Use the drop down list to select the “Open a Object Explorer and New Query”. The default is shown below in the screen shot.
Once you have made the change, you can use the following command to launch SSMS connected to the instance you want:
ssms -S <server name> -E –nosplash
SSMS Command Line Options
—————————
Microsoft SQL Server Management Studio
—————————
Usage:
ssms.exe [-S server_name[\instance_name]] [-d database] [-U user] [-P password] [-E] [file_name[, file_name]] [/?]
[-S The name of the SQL Server instance to which to connect]
[-d The name of the SQL Server database to which to connect]
[-E] Use Windows Authentication to login to SQL Server
[-U The name of the SQL Server login with which to connect]
[-P The password associated with the login]
[file_name[, file_name]] names of files to load
[-nosplash] Supress splash screen
[/?] Displays this usage information
Pingback: How to open Management Studio with the Object Explorer and a Query … « Internet Cafe Solution
Which version of SQL Server does this work with?
It doesn’t work with SS 2008 (not R2).
This seems to have been a bug in SSMS. See
https://connect.microsoft.com/SQLServer/feedback/details/155855/ssms-command-line-startup-not-connecting-to-object-explorer
LikeLike
I am able to do this for SSMS for SQL Server 2008 R2 using the following command: ssms -S -nosplash
LikeLike
Thank you Amit. I will have a chance to try this in R2 later this week.
— Mike
LikeLike