• Joshua Perry (3/19/2008)


    The answer is absolutely wrong. You can't use sp_unsetapprole because the cookie was never set using sp_setapprole. If you activate the app role before setting the cookie using sp_setapprole, you can only get the original context by disconnecting and reconnecting. sp_unsetapprole only works if you first use sp_setapprole to create the cookie.

    [font="Courier New"]"You are testing an application role in SQL Server 2005. You connect with SSMS, invoke the role, and then execute various queries and stored procedures. What can you do to return to your normal account permissions? (select all that apply)"[/font]

    Actually, you invoke the role using sp_setapprole, so you can use sp_unsetapprole to revert to your original context. If there is another way to invoke an application role without using sp_setapprole, I'd like to know what it is.

    😎