It’s very common practice a database administrator guy has two login as WINDOWS authentication and a SQL’s sysadmin at database box. DBA guy always connect DB Server from their own working workstation (Desktop/Laptop) via SQL Server Management Studio (SSMS). Sometimes it happens we have to connect Server from different workstation, in this situation we have to use own windows credential instead of local workstation. To use the different login to connect to SQL Server using SSMS we need to use the “Run as” feature. To do this there are many option, some of few are as,

1)Run As different User :

Just go to at SSMS.exe, Press and Hold the Shift Key and Right Click on the SSMS executable, Now select “Run as Different User” option.
or
Click on Start Button, Go to SSMS and, Press and Hold the Shift Key and Right Click on the SSMS.
It will be look like as below

It will ask user name and password as below, write Username and password, it will connect to database server with given credential.

2) Run As from Command Prompt :

Just open the command prompt ( Start ->Run->CMD)

At your command prompt, write as

Runas /user:VirendraRnD\Virendra “C:\Program Files\Microsoft SQL Server\120\Tools\Binn\ManagementStudio\Ssms.exe”
or
Runas /user:VirendraRnD\Virendra SSMS.EXE

or

It will ask password for given user.
Note : SSMS.EXE path may be changed as per your installation or SQL server version. Use RUNAS / NETONLY If the credentials specified are for remote access only.

3)Run As from RUN Command :

Step -1 : Go to Start -> Run,
Step -2 : Type following command in text box and press enter, this will launch command prompt to get user’s password:


Happy Reading, Please suggest other options !

Advertisements
Comments
  1. Thayal Muhunthan says:

    Good article. runas /netonly /user:xxxx@domain.local “C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\Ssms.exe”

    Like

  2. paschott says:

    Use windows Credential Manager – put in the actual name/ip address and port for the sql server, along with the login/password and you can connect directly without a RUNAS command. That makes it much easier when you hit something like an add-in upgrade or something similar. I used to get all sorts of fits if doing that and then prompted for a SQL Prompt upgrade. Eventually I’d get to a screen that was completely black because I was using RUNAS. Using credential manager was much easier after the initial setup and let me run everything in one SSMS session. It also worked for connecting in other tools – VS, SSDT, Excel, etc.

    Liked by 1 person

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s