How to Run SQL Server tools with Alternative Credentials

How to Login to as Different User
or
How to RunAs in Command Line


Problem: One of the common problem is, how to login to SQL Server tools using different credentials and save it so, don't have to manually enter user name and password again and again

Solution:

Method1:
If you are starting from the Desktop in Windows Vista, Windows 7, or Windows Server 2008 and Windows Server 2008 R2, you can do the following:
  1. Click Start (also shown as the circular Windows logo in the Start menu).
  2. Type Command Prompt and right-click Command Prompt when it appears in the Start menu. From the resulting context menu, click Run as administrator.
As another example, assume that you are logged on as a typical domain user to a workstation in the domain, but you needed to run several tools using a more privileged account. You could do the following:
  1. Open a Command Prompt window. Click Start, click Run, type cmd and press ENTER.
  2. In the Command Prompt window you just opened, type runas /user:<domain\username> cmd and press ENTER to open another Command Prompt using alternate credentials. Substitute the actual domain and username of the account you want to use for <domain\username>. For example, assume that the administrator account name is mshah in the domain XYZ.com, the command would look like this runas /user:xyz\mshah.







Comments

Popular posts from this blog

Calculating Age of the person in T-SQL

How to Troubleshoot Subscription issue in Reporting Services

MDX Queries - Current Day - Month and Year