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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SQL Server 2012 Database Restore 4 38
TSQL Challenge... 7 35
Query for timesheet application 3 17
SQL 2012 clustering 9 11
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.
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed

809 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