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,209 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 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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
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.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

630 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