Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12

Impersonation in an Execute As statement Expand / Collapse
Author
Message
Posted Thursday, May 15, 2008 2:28 PM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Thursday, December 4, 2014 12:15 PM
Points: 1,570, Visits: 685
(1) The 'must' gives it away, you don't have to use REVERT or another EXECUTE AS statement to change your context back.

(3) If you're an sa, you can impersonate a user with Execute As User, hence #3 is wrong - a member of the sysadmin role can use database level impersonation.

(4) "Explicitly Defined" in terms of executing as a Login or User - Execute As Login gives you impersonation at the server level, i.e. all databases, Execute As User gives you impersonation at the database only level, you can't switch to another database.

This one was pretty clear-cut ...



Post #501627
Posted Thursday, May 15, 2008 3:06 PM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Wednesday, December 10, 2014 12:22 PM
Points: 2,671, Visits: 787
Thanks Simon. Makes sense now.

Jamie
Post #501657
Posted Thursday, May 15, 2008 3:48 PM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: 2 days ago @ 8:26 AM
Points: 10,381, Visits: 13,436
Simon Facer (5/15/2008)

(4) "Explicitly Defined" in terms of executing as a Login or User - Execute As Login gives you impersonation at the server level, i.e. all databases, Execute As User gives you impersonation at the database only level, you can't switch to another database.

This one was pretty clear-cut ...


I guess it was clear cut if you defined scope as Server (Login) or Database(Level). The way I defined scope was how long the impersonation lasted. Similar to the scope of a variable in C# or VB, or that you had to explicitly REVERT.




Jack Corbett

Applications Developer

Don't let the good be the enemy of the best. -- Paul Fleming

Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
How to Post Performance Problems
Crosstabs and Pivots or How to turn rows into columns Part 1
Crosstabs and Pivots or How to turn rows into columns Part 2
Post #501686
Posted Thursday, May 15, 2008 3:56 PM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Thursday, December 4, 2014 12:15 PM
Points: 1,570, Visits: 685
Talking of VB or C# - I guess 'scope' is an 'overloaded' term ... different meaning depending on circumstance.



Post #501693
Posted Thursday, May 15, 2008 11:16 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Tuesday, February 7, 2012 10:15 AM
Points: 60, Visits: 34
I totally agree to that. For more info see

The change in execution context remains in effect until one of the following occurs:

1.Another EXECUTE AS statement is run.
2.A REVERT statement is run.
3.The session is dropped.

http://msdn.microsoft.com/en-us/library/ms181362.aspx
Post #501773
Posted Sunday, May 18, 2008 10:05 AM
SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Monday, December 15, 2014 4:15 AM
Points: 5,471, Visits: 1,402
A good one.........


Post #502619
Posted Tuesday, May 27, 2008 8:22 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Friday, November 7, 2014 3:55 PM
Points: 69, Visits: 203
Happened exactly the same to me, cause I choosed 2 & 3. Simply, I'm going to check it out on the SQL Server, and I'll see what happens with the DBO/SYSADMIN issue over the EXECUTE AS command; which as far as I can see has been the hot topic here for most of us.
Post #507372
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse