Re: EXEC in stored procedure
From: Tom Moreau (tom_at_dont.spam.me.cips.ca)
Date: 10/26/04
- Next message: Steve Ricketts: "Re: One Web Service updates SQL, another can't?"
- Previous message: Kalen Delaney: "Re: EXEC in stored procedure"
- In reply to: Magnus Blomberg: "EXEC in stored procedure"
- Next in thread: Aaron [SQL Server MVP]: "Re: EXEC in stored procedure"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
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
- Next message: Steve Ricketts: "Re: One Web Service updates SQL, another can't?"
- Previous message: Kalen Delaney: "Re: EXEC in stored procedure"
- In reply to: Magnus Blomberg: "EXEC in stored procedure"
- Next in thread: Aaron [SQL Server MVP]: "Re: EXEC in stored procedure"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|