SQLServer-DBA.com Links

Subscribe to newsletter

Dba_db2_button

Powered by TypePad
SQL Server - Open SSMS on the Command Line

10 July,2012 by Jack Vamvas

Question: How can I open the SQL Server Management Studio (SSMS) from the command Line? I want to  create a batch file , place it on a users desktop (or personal folder) . The batch file should have a command line instructions to open the SSMS  and connect to a SQL Server Instance with the users Active Directory (AD) credentials.

Answer: The ssms utility , which is part of the SQL Server Management Studio installation, can open SSMS. A simple example , which opens SSMS  , connects to a SQL Server Instance with the users Windows logon details. Adding the –nosplash parameter , stops the SSMS splash screen from appearing.  

ssms  -E -S MYSERVER\MYINST1 -nosplash

 

If the SSMS Object Explorer does not appear , a modification needs to occur on the Tools | Options section.

Open the SSMS Options with  Tools | Options

In the Environment | General Section  - on the right panel you’ll see At Startup : Open Object Explorer

Ssms_command_line

Change the default At startup  to Open Object Explorer and new query.

Run the command again – and if you logon successfully the Object Explorer will appear

Now it’s just a matter of placing the command line in a batch file , and it can be a reusable script.

Other options exist for the ssms utility – including SQL Server logon and  scriptfile options. Read SQL Server Books Online for more details

 


Author: Jack Vamvas (http://www.sqlserver-dba.com)

******** *******

Subscribe to SQLServer-DBA.com

Latest posts delivered to you daily

Delivered by FeedBurner

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment


sqlserver-dba.com | SQL Server Performance Tuning | SQL Server DBA:Everything | FAQ | Contact|Copyright & Disclaimer