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»»

Execute As Expand / Collapse
Author
Message
Posted Tuesday, February 1, 2011 8:54 PM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Monday, July 28, 2014 8:33 AM
Points: 2,842, Visits: 714
Comments posted to this topic are about the item Execute As
Post #1057179
Posted Tuesday, February 1, 2011 10:24 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Friday, October 21, 2011 12:17 PM
Points: 103, Visits: 158
Hello I noticed in the article that you say the test database will be called MyTesting, however the script creates it as TestDB. Just thought I'd point this out. Otherwise, good article from what I can tell without actually running the code.

Cheers,

Charley
Post #1057188
Posted Wednesday, February 2, 2011 8:20 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Yesterday @ 8:06 PM
Points: 36,786, Visits: 31,243
I haven't taken the time to run the code yet either... but I did read the article. The title of the article doesn't even come close to describing the great features used in this article. I realize that EXECUTE AS is the main purpose of the article but this article also does a very, very nice job of providing an introduction to one important type of security. I'd call the article something like "Restricting Access Using EXECUTE AS".

If the code in this article turns out to be as good as the article itself, I'll be making a permanent link to this one. It's short, sweet, and very much to the point.

Well done, Patrick.


--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #1057499
Posted Wednesday, February 2, 2011 8:28 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Monday, July 28, 2014 8:33 AM
Points: 2,842, Visits: 714
Jeff, thank you for the kind words. This is my first article, and I found out that coming up with a good title is more difficult than it seems.
Post #1057507
Posted Wednesday, February 2, 2011 1:37 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Monday, February 24, 2014 1:49 PM
Points: 27, Visits: 289
I think that the following line of code only works on SQL 2008

DECLARE @i INT = 10

In SQL 2005, it should be

DECLARE @i INT
SET @i = 10


--------------------------------------------------------------
DBA or SQL Programmer? Who Knows.
Post #1057679
Posted Wednesday, February 2, 2011 4:07 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Friday, October 21, 2011 12:17 PM
Points: 103, Visits: 158
You're right the one can't declare and assign in the same line with local variables in SQL 2005. Adding that feature in SQL 2008 made turning ad-hoc versions of stored procedures sooo much easier.
Post #1057731
Posted Wednesday, February 2, 2011 6:09 PM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Thursday, June 26, 2014 5:34 AM
Points: 897, Visits: 1,486
Thank you for your article, Patrick.

Not only does it cover the implementation of EXECUTE AS but it also demonstrates a very interesting example of certificates and builtin criptography. Much appreciated contribution.


Best regards,

Andre Guerreiro Neto

Database Analyst
http://www.softplan.com.br
MCITPx1/MCTSx2
Post #1057767
Posted Wednesday, February 2, 2011 11:15 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Yesterday @ 8:06 PM
Points: 36,786, Visits: 31,243
Patrick Cahill (2/2/2011)
This is my first article...

Then my hat is really off to you, Patrick. Comprehesive code with a decent format embedded in a well written article that explains everything along the way... you just can't ask for much better on your maiden voyage as an author. Well done, again!

...and I found out that coming up with a good title is more difficult than it seems.

Heh... you noticed that? Even a well written fellow like Steve Jones runs into that problem. However, if that's the worst problem with one of your articles, it's not really a problem


--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #1057827
Posted Wednesday, February 2, 2011 11:17 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Yesterday @ 8:06 PM
Points: 36,786, Visits: 31,243
charles evans (2/2/2011)
You're right the one can't declare and assign in the same line with local variables in SQL 2005. Adding that feature in SQL 2008 made turning ad-hoc versions of stored procedures sooo much easier.


All MS needs to do now is figure out that column and variable selection along with variable assignment in the same SELECT (kind of like they do in update) would be incredibly useful and my day would be made!


--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #1057828
Posted Friday, February 4, 2011 8:52 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, August 23, 2013 1:30 PM
Points: 1, Visits: 35
Thanks for the article, very helpful on many levels. This is the most straightforward and concise discussion of execute as and encryption that I've encountered. Great article.
Post #1058809
« Prev Topic | Next Topic »

Add to briefcase 12»»

Permissions Expand / Collapse