views:

1271

answers:

2

Usually, when using Windows Authentication, the software (eg Internet Explorer) tries to use Windows Authentication, and if it doesn't succeed (because the domain is untrusted, or because the credentials are not ok for example), it just popups a login window so that you can input your domain, login and password.

With sql Server Management Studio 2008, if I select "Windows Authentication", the login/password boxes are autopopulated with my current credentials, and if I try to login, it says :


Login failed. The login is from an untrusted domain and cannot be used with Windows authentication. (Microsoft SQL Server, Error: 18452)


I never get a chance to enter my credentials on the server domain...

I know I can fix this by either joining the domain on my computer, or enabling "sql server authentication", but that's not what I want :)

Any ideas on how to solve this?

+1  A: 

Trusted Authentication will use the credentials that you are logged into the machine with to try and connect, there’s not a way round this, if you want to use trusted authentication for management studio, you need to be logged on to your machine with an account that is allowed access to SQL, if not then you will have to use SQL authentication.

Edit: As posted by Gulzar, RunAs would be a definate solution to this.

Sam Cogan
If I connect using internet explorer to IIS configured with Window Authentication, if my current credentials doesn't get me into the website, IE will popup a window, giving me a chance to enter other credentials... In other words, it seems to me the limitation is in SQLStudion, not NTLM. Am I wrong?
Brann
Well its a limition in MSSQL itself, rather than Managment studio.
Sam Cogan
+4  A: 

try this: Use RUNAS to set your Windows Auth domain for database connections

runas /user:domain\user “C:\Program Files\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\ssmsee.exe” 

runas /user:domain\user “C:\WINDOWS\system32\mmc.exe /s \”C:\Program Files\Microsoft SQL Server\80\Tools\BINN\SQL Server Enterprise Manager.MSC\”" 

runas /user:domain\user isqlw
Gulzar
although the user I created on my local computer is not on the same domain as the server, it worked ! thanks :)
Brann