Go Premium for a chance to win a PS4. Enter to Win

x
?
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
Medium Priority
?
1,249 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 2000 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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.

972 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