Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Connect different Windows User in SQL Server Management Studio (2005 or later)

Is there a way in SQL Server Management Studio 2005 (or later) to change the Windows Authentication user (as you could in SQL Server 2000 and older)?

This is the general connection properties dialog(note the greyed out UID/PWD when selecting Windows Auth):

dialog

FYI - One workaround is to use runas but I'm looking for a solution that will allow me to work with multiple Windows accounts across multiple servers (and across multiple domains).

like image 573
Matt P. Avatar asked May 11 '09 17:05

Matt P.


People also ask

How do I connect to SQL Server with a different user?

The quick solution is to hold the Shift-key while right clicking the SSMS shortcut in the start menu. Then the 'Run as different user' option appears, which allows you to enter different credentials.

How do I change the Windows Authentication user in SQL Server Management Studio?

Change authentication mode with SSMSIn SQL Server Management Studio Object Explorer, right-click the server, and then click Properties. On the Security page, under Server authentication, select the new server authentication mode, and then click OK.

How do I run SQL Server Management Studio as another user in Windows 10?

If you are using Windows 10, the way to do this is to hold the Shift key before you right-click the SSMS link. Then you see this instead: And you can then choose the Run as a different user option to log on as someone else just for this one application.


2 Answers

While there's no way to connect to multiple servers as different users in a single instance of SSMS, what you're looking for is the following RUNAS syntax:

runas /netonly /user:domain\username program.exe 

When you use the "/netonly" switch, you can log in using remote credentials on a domain that you're not currently a member of, even if there's no trust set up. It just tells runas that the credentials will be used for accessing remote resources - the application interacts with the local computer as the currently logged-in user, and interacts with remote computers as the user whose credentials you've given.

You'd still have to run multiple instances of SSMS, but at least you could connect as different windows users in each one.


For example: runas /netonly /user:domain\username ssms.exe
like image 156
SqlRyan Avatar answered Sep 26 '22 02:09

SqlRyan


Hold shift and right click on SQL Server Mangement studion icon. You can Run as other windows account user.

like image 39
Suresh Avatar answered Sep 24 '22 02:09

Suresh