Solved

The current security context cannot be reverted. Please switch to the original database where 'Execute As' was called and try it again.

Posted on 2010-09-17
3
1,101 Views
Last Modified: 2012-05-10
is it possible to, with a query, check which database originated the original 'execute as'. there are too many databases, and not sure which one was used.. any quicker way than trial and error?
0
Comment
Question by:anushahanna
  • 2
3 Comments
 
LVL 20

Accepted Solution

by:
Marten Rune earned 500 total points
ID: 33707042
No quicker way I know of. In your code, use master as switching db.

i e

use master
go
execute as login = 'aAccountHere'
use
specialDB
exec sp_dowhateverhere
use master
revert

Regards Marten
0
 
LVL 20

Expert Comment

by:Marten Rune
ID: 33707645
Well you can always kill the session and start over ofcourse

//Marten
0
 
LVL 6

Author Comment

by:anushahanna
ID: 33728671
Thanks Marten.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now