skip to main | skip to sidebar

I hear C#, I see C#, I do .Net

Friday, July 20, 2007

EXECUTE AS clause (TSQL)

"By specifying the context in which the module is executed, you can control which user account the SQL Server 2005 Database Engine uses to validate permissions on objects that are referenced by the module." - BOL

The Options

{ EXEC | EXECUTE } AS { CALLER | SELF | OWNER | 'user_name' }

This applies to create procedure statement:

CREATE { PROC | PROCEDURE } [schema_name.] procedure_name [ ; number ] 
    [ { @parameter [ type_schema_name. ] data_type }
        [ VARYING ] [ = default ] [ OUT | OUTPUT ]
    ] [ ,...n ]
[ WITH <procedure_option> [ ,...n ] ]
[ FOR REPLICATION ]
AS { <sql_statement> [;][ ...n ] | <method_specifier> }
[;]
<procedure_option> ::=
    [ ENCRYPTION ]
    [ RECOMPILE ]
    [ EXECUTE_AS_Clause ]
Posted by petar at 1:09 PM
Labels: SQL

0 comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

Blog Archive

  • ▼  2007 (12)
    • ►  December (2)
      • Anatomy Of Lambda Expressions in C# - for beginner...
      • Anatomy Of Lambda Expressions in C# - for beginner...
    • ▼  July (3)
      • EXECUTE AS clause (TSQL)
      • SQL 2000->2005 migration
      • The 10 mistakes that put projects at risk of failu...
    • ►  June (5)
      • What OS is on your development box?
      • WCF - for VS 2005 resources
      • Monitors
      • Bloom Filter
      • TechEd
    • ►  February (2)
      • Comment on 100 patterns every developer should kno...
      • Noteworthy Feb, 2007

About Me

My Photo
petar
View my complete profile

What I am reading..