When connecting to a server from SSMS using Windows Authentication, you are limited to using only user which you used to log on to Windows. For example, if you login using User1 on Windows and launch SSMS, you can only use User1 to connect to a server from SSMS as shown below, the User name box is grayed out:
To use a different user without logging of and logging in as different user on Windows, you can use RunAs command to launch an application under different user’s context.
The general syntax for RunAs is as follows:
RunAs /user:DOMAIN\UserName ProgramName
To Run SSMS as different Windows user:
1. Go to Start -> Run,
2. Type following command in text box and press enter, this will launch command prompt to get user’s password:
3. Provide user’s password and press enter:
Enter the password for VGAJJAR\User2:
This will launch SSMS under User2‘s context.
Using this method you can run multiple instances of SSMS side-by-side under different user contexts:
To get more information about RunAs parameters, type RunAs /? at command prompt.
Hope This Helps!
If you like this post, do like my Facebook Page -> SqlAndMe
EMail me your questions -> Vishal@SqlAndMe.com
Follow me on Twitter -> @SqlAndMe