Sql Management Console

Connect as another user with Windows Authentication

When diagnosing issues with applications running against secure databases; the issue of what the application can actually access can be non-trivial to determine. One simple way of gaining understanding of what your application is seeing is by logging into SQL Management console as the application user.

Normally the ability to choose your login is grayed out (the login and password boxes are for SQL logins only); however you can change this pre-filled user by when starting the Management console; right click "Run As" the windows user account in question.

For some reason the Run As option isn't always available therefore you can use the following command line workaround:

runas /noprofile /user:DOMAIN\USER "C:\Program Files\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\SqlWb.exe"

You will be prompted for the account password.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License