Archive

Posts Tagged ‘SQLWB’

Management Studio Startup Parameters – Tips & Tricks

18.04.2011 2 comments

What do we do when we open SQL Server Management Studio? 99% of the time we connect to the server! ?

image 

This can be automated using the command-line options available for management studio. You can see full list of available command-line options, go to Start > Run > type “SSMS /?”:

image 

This will display the all available options which can be used with SSMS,

image 

The options are self-explanatory, the -E is used for Windows Authentication. – U, – S are used for SQL Server Authentication Both should be mutually exclusive. if you used together the SQL Server Authentication will take precedence. for example, to connect to default instance of local SQL Server execute below from Start > Run or from CMD.

SSMS S (local) –E
— connect to default instance using Windows Authentication

SSMS S (local)InstanceName –E
— connect to named instance using Windows Authentication

SSMS S (local) U sa P P@$$w0rD
— connect to default instance using SQL Server Authentication

SSMS S (local) E U sa P P@$$w0rD
— connect to default instance using SQL Server Authentication
— SQL Server Authentication takes precedence

SSMS S (local) E C:MyQuery.sql
— connect to default instance using Windows Authentication
— and open a saved query file

SSMS S (local) d AdventureWorks2008R2 E
— connect to default instance using Windows Authentication
— and change context to AdventureWorks2008R2 database

All the options described above are for SQL Server 2008. The same options can be used with SQL Server 2005. However, for SQL Server 2005, replace SSMS.exe with SqlWb.exe.

Hope This Helps!

Vishal