?
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,229 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

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

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
An alternative to the "For XML" way of pivoting and concatenating result sets into strings, and an easy introduction to "common table expressions" (CTEs). Being someone who is always looking for alternatives to "work your data", I came across this …
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
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

719 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