Re: EXEC in stored procedure

From: Tom Moreau (tom_at_dont.spam.me.cips.ca)
Date: 10/26/04


Date: Tue, 26 Oct 2004 13:17:42 -0400

When you use:

   EXEC ('SELECT * FROM Categories')

... you are using dynamic SQL. Thus, the person running it must have their
permissions checked against the underlying objects - Categories, in this
case.

-- 
Tom
---------------------------------------------------------------
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com
"Magnus Blomberg" <magnus.blomberg@skanska.se> wrote in message
news:utP4%2373uEHA.4084@TK2MSFTNGP10.phx.gbl...
Hello!
I'm trying to use
   EXEC ('SELECT * FROM Categories')
into a Stored Procedure, but the users get permission denied on object
'Categories'
If I'm using
   SELECT * FROM Categories
everything works.
The user haven't any permission of Categories, but the SP should have it.
Is the EXEC command inside the SP run as the user? Why?
Regards Magnus


Relevant Pages

  • Re: EXEC in stored procedure
    ... permissions checked against the underlying objects - Categories, ... SQL Server MVP ... The user haven't any permission of Categories, but the SP should have it. ... Is the EXEC command inside the SP run as the user? ...
    (microsoft.public.sqlserver.programming)
  • Re: Complete Neophyte Question(s)
    ... You should not have to go Google to find out what WITH GRANT means. ... Server comes with online documentation on you hard disk. ... WITH GRANT is one of the more esotheric features in SQL Server in my ... Or does that depend on the permission? ...
    (microsoft.public.sqlserver.security)
  • Permission denied error 2nd Post
    ... New user of SQL ... Greg that the web user should not normally have that level of permission. ... >> fixed server roles. ... The CREATE DATABASE permission must be explicitly ...
    (microsoft.public.dotnet.framework.aspnet)
  • Permission denied error 2nd Post
    ... New user of SQL ... Greg that the web user should not normally have that level of permission. ... >> fixed server roles. ... The CREATE DATABASE permission must be explicitly ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Object permissions
    ... only the owner can set the RWOP property on a query. ... Once I removed that line from the sql, ... you grant modify permission on the qryAttendanceActual query. ...
    (microsoft.public.access.security)

Quantcast