Connect To A Database Using Windows Authentication With Different Credentials

A handy little 'quick trick' of the day. After pivoting several times in a network I often find myself thinking pretty hard about how to do things that might otherwise be easy, like connecting to a database.

This takes a touch more effort once you are forwarding your traffic through an intermediary and connecting with the one account you have that has admin privileges on a box. Perhaps you want to try your connection to the database (using Windows Auth) with some different creds. One method that has worked for me in the past has been to use the 'runas' command to open the SQL Server Management Studio like this:

runas /netonly /user:domain\name "C:\PATH_TO_SMS\Ssms.exe"

Hope this is useful to someone besides me.