Tuesday, August 24, 2010

Access a Remote SQL Server as Another Windows User

On a production SharePoint server we do not have SQL installed, or the SQL Management Studio.  My account does not have access to the box that hosts SQL.  When I tried to open the server in SQL Server Management Studio, using Windows Authentication, I found that I am unable to change the account that is used to authenticate to SQL Server.

The trick is to run SQL Server Management Studio as another user.  This can be done by opening a command prompt and issuing the following command (replace the sections in brackets with your own domain and account information):

runas /netonly /user:{domain}\{sp_admin account} "C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\Ssms.exe"
You'll be prompted:

Enter the password for {domain}\{sp_admin account}:

Enter the password and voila! you are connected to SQL Server as another user!

No comments:

Post a Comment