solving sql server problems for millions of dbas and developers since 2006



SQL Server DBA Tips SQL Server Developer Tips SQL Server Business Intelligence Tips SQL Server Career Tips SQL Server Tip Categories SQL Server Tutorials SQL Server Webcasts SQL Server Whitepapers SQL Server Tools SQL Server Questions and Answers MSSQLTips Authors About MSSQLTips SQL Server User Groups MSSLQTips Giveaways MSSQLTips Advertising Options

MSSQLTips Facebook Page MSSQLTips LinkedIn Page MSSQLTips RSS Feed MSSQLTips Twitter Page MSSQLTips Google+ Page





SQL Product Highlight

Idera - SQL safe backup

Idera's SQL safe provides a high-performance backup and recovery solution for Microsoft SQL Server. SQL safe saves money by reducing database backup time by up to 50% over native backups and reducing backup disk space requirements by up to 95%. SQL safe also enables complete "hands-free" automated backup of your entire SQL Server infrastructure and ensures compliance with your organization's backup and recovery policies. From implementations with tens of SQL servers to enterprises with hundreds of servers spread around the globe, SQL safe is the only SQL Server backup and recovery solution that scales to meet the challenge.

Learn more!




Issues with Run As to Start SQL Server Management Studio with a Different Login

By: | Read Comments (2) | Print

Jugal has 8+ years of extensive SQL Server experience and has worked on SQL Server 2000, 2005, 2008 and 2008 R2.

Related Tips: More

Problem

As a best practice in the industry, a DBA often has two logins that are used to access SQL Server; one is their normal Windows login and the other is an admin level login account which has sysAdmin rights on the SQL Server boxes. In addition, most of the time the SQL Server client tools are only installed on the local desktop and not on the servers. So in order to use the different login to connect to SQL Server using SSMS you need to use the "Run as" feature, but when doing this you may get this error message "The directory name is invalid". In this tip we look at how to resolve this issue.

Solution

As mentioned above when using the "Run as" feature you may get this error message: "The directory name is invalid" as shown below.

in order to use the different login to connect to SQL Server using SSMS you need to use the "Run as" feature, but when doing this you may get this error message

The reason this occurs is if the "Start in" property is set to %HOMEDRIVE%%HOMEPATH% on the Shortcut tab of the SSMS Properties dialog box. In Windows XP and Windows Server 2003, we cannot use the "Run as" feature to access the logged in user's mapped home drive.

SSMS Properties dialog box

To fix this problem we can do as follows:

Step 1:
Click Start, point to All Programs, and then point to SQL Server Management Studio.

Click Start, point to All Programs, and then point to SQL Server Management Studio

Step 2:
Right-click SQL Server Management Studio and then click Properties.

click SQL Server Management Studio and then click Properties

Step 3:
In the Start in box, change the value from %HOMEDRIVE%%HOMEPATH% to value %WINDIR%. and Click OK as shown below.

sql server management studio properties

Step 4:
Right Click on SQL Server Management Studio and Click on "Run as", if the Run as option does not come up press Shift and Right Click. At this point, specify the login account you want to use and SSMS should work for you.

Click on SQL Server Management Studio and Click on "Run as"

Next Steps

  • You can also use this solution with other programs such as Internet Explorer, and other tools if you are facing this kind of issue.
  • Take a look at these other tips about SQL Server Management Studio


Related Tips: More | Become a paid author


Last Update: 11/12/2010

Share: Share 






Comments and Feedback:

Tuesday, November 23, 2010 - 5:30:22 AM - mordino Read The Tip

I've successfully used the "Run as..." option for SQL Server Management Studio 2008 on Windows XP. But SQL Server Management Studio 2008 on Windows 7 i only do have the options of Open (meaning Run as current user) and Run as Administrator.

So i am not able anymore to connect with an Admin Account. Any advice how to re-enable the "Run as..." option for Windows 7?


Tuesday, November 23, 2010 - 6:30:10 AM - Jugal Shah Read The Tip

Press the Shift Key and Right Click on SSMS you can see the Run As... Option

Thank You, Jugal Shah



Post a Comment or Question

Keep it clean and stay on the subject or we may delete your comment.
Your email address is not published. Required fields are marked with an asterisk (*)

*Name   *Email   Notify for updates
Comments
*Enter Code refresh code


 
Sponsor Information
"Amazing, Amazing, Amazing! SQL doctor is truly one of the most powerful tools I have seen."

SQL Monitor – For database professionals who need results on Day One. Try it online.

SQL Servers keeping you up at night? Contact expert SQL Server consultants for a Health Check.

Find and Fix SQL issues with Foglight Performance Analysis. Get a free copy.

Solving SQL Server problems for millions of DBAs and Devs since 2006. Join now.

Are you waiting on SQL Server? Learn about these DMV's.


Copyright (c) 2006-2012 Edgewood Solutions, LLC All rights reserved
privacy | disclaimer | copyright | advertise | about
authors | contribute | feedback | giveaways | user groups
Some names and products listed are the registered trademarks of their respective owners.


Edgewood Solutions LLC | MSSharePointTips.com | MSSQLTips.com