How to create a "run as different user" shortcut for SQL Server

Problem: I always need to open SQL Server using my admin account but I don't want to keep on doing right click + run as different user, then type my admin username and super long admin password.

My solution? I created a shortcut that launches SQL Server using a different user. Now all I have to do Run "sqlserver" and the app will automatically open using my admin account. Saved me a lot of keystrokes! Hahaha


Create a shortcut to SQL Server with the following target and place it in your User folder.

C:\Windows\System32\runas.exe /savecred /user:domain\surfandperf-admin "C:\Program Files (x86)\Microsoft SQL Server Management Studio 18\Common7\IDE\Ssms.exe"

In detail:

  1. Navigate to where your SQL Server executable file is.
    Usually it's inside C:\Program Files (x86)\Microsoft SQL Server Management Studio 18\Common7\IDE\ as ssms.exe
  2. Right click ssms.exe >> Send to >> Desktop (creates a shortcut)
  3. On your Desktop >> right click the SQL Server shortcut created >> go to Properties >> update the target to this:

    C:\Windows\System32\runas.exe /savecred /user:domain\surfandperf-admin "C:\Program Files (x86)\Microsoft SQL Server Management Studio 18\Common7\IDE\Ssms.exe"

    Basically I just prepended the target with the red text, making sure to replace the /user:domain\surfandperf-admin part with the domain and username I want to login with.

    I used /savecred to save the password for future launches

  4. Move to the shortcut to your user folder and rename it with whatever you want the shortcut name to be. Your user folder is inside C:\Users

  5. Now you can launch it using the run dialog (Win + R).

On first launch it will ask for a password, then it will remember it until you change your password.

Hope it works! I really just want fewer clicks and keystrokes for everything hehe.