User Emulation for Query Analyzer??

  • Hello,  I am training customers on a proprietary system linked to an ODBC SQL database.  I need to show the customers what their basic user/groups/roles security would look like running Query Analyzer and I need to be able to do it 'on the fly'.  Is there a user emulation function that I can set up in Enterprise Manager to switch over to this restricted user without logging out and logging back in?

    Thanks in advance!

  • if you're running a query then the statement

    execute as 'mytestuser'

    execute as self

    execute as caller

    might help

    look up "execute as" in books online for more details

    MVDBA

  • Not sure what you want to show.  If it is just how a query would work, you can do SETUSER in the query window to test being a specified user.  But that only works if the user is a sysadmin. You can also create multiple windows in QA using different logons.  Just choose File - Connect from the menu in QA.

    Another thing you can do is have multiple connections in EM, with different logons for each one.  You can only do this using SQL logons (not windows authentication) of course.  Create a server name alias using the Client Network Utility, then create a new connection in EM using the server alias and a SQL logon.

    Hope this helps.

    EDIT: Michael; I believe "execute as" is SQL 2005 only.



    Mark

  • Or you can use RunAs at the operating system level. Hold down the shift key as you right click on Enterprise Manager or Query Analyzer. In the pop-up menu you'll have an option for Run as. Choose it and it will allow you to start the program under a different set of Windows credentials.

    Incidentally, if you follow the best practice of all privileged users having two accounts, a normal account without advanced privileges and another one with the privileges, you can have users log in as their normal account. However, they can always administer their systems as the second account simply by using Run As without having to logout and log back in.

    K. Brian Kelley
    @kbriankelley

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply