Re: using EXECUTE AS for stored procedures, sql 2005



On Mon, 31 Aug 2009 11:15:03 -0600, msnews.microsoft.com wrote:

Can you define "Owner" when using EXECUTE AS Owner for a stored procedure?

Each stored procedure has one, and exactly one account that is
considered to be its owner. This account is impersonated when using
EXECUTE AS OWNER.

Does that mean the stored procedure will be executed as the owner of the
stored procedure?

To be more precise, during execution of the stored procedure, you will
execute from the security context of said owner.

Who is the owner of the stored procedure, the creator?

By default, yes. But that can be changed by using ALTER AUTHORIZATION.

Wouldn't that be the same as Self then. Can I set the owner to a particular
account, and if so, how?

See above.

--
Hugo Kornelis, SQL Server MVP
My SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis
.



Relevant Pages

  • Re: pass stored procedure parameters in asp
    ... In Management Studio, open a new query window, logging in with the bettys ... account and try to execute the procedure. ... procedure and properties) of voidTran stored procedure and other ...
    (microsoft.public.inetserver.asp.general)
  • Re: pass stored procedure parameters in asp
    ... Yes, I did log in as bettys and execute voidTran, no problem at all. ... account and try to execute the procedure. ... procedure and properties) of voidTran stored procedure and other ...
    (microsoft.public.inetserver.asp.general)
  • Re: SQL Server 2005 Stored Procedure security annoyances
    ... Can you grant an EXECUTE permission on stored procedure? ... I have came to the maturity level to stop using the sa account when I ... I mean it is unrealistic to have to manually set for each SP the rights ...
    (microsoft.public.sqlserver.security)
  • Re: pass stored procedure parameters in asp
    ... bettys account and try to execute the procedure. ... you can use the EXECUTE AS statement to test the ... procedure and properties) of voidTran stored procedure and other ... This email account is my spam trap ...
    (microsoft.public.inetserver.asp.general)
  • Re: SQL Server Agent jobs - The specified @job_name does not exist.
    ... > NETWORK SERVICE as the ASP.NET account. ... > a stored procedure in the database which attempts to use ... > The only way I can get the procedure to execute is by ... > login and cannot be selected as the job owner? ...
    (microsoft.public.sqlserver.security)

Loading