Re: EXECUTE permission denied on nested procedure call
From: Erland Sommarskog (sommar@algonet.se)
Date: 01/06/03
- Next message: Erland Sommarskog: "Re: Update statement"
- Previous message: Leon Parker: "Update statement"
- In reply to: Eran: "Re: EXECUTE permission denied on nested procedure call"
- Next in thread: Eran: "Re: EXECUTE permission denied on nested procedure call"
- Reply: Eran: "Re: EXECUTE permission denied on nested procedure call"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
From: Erland Sommarskog <sommar@algonet.se> Date: Mon, 6 Jan 2003 21:43:15 +0000 (UTC)
[posted and mailed]
Eran (eran.librach@verizon.net) writes:
> Enclosed you'll find sample code for a small console app
> which tries to execute SP1. It reproduces the problem
> once run from the user account granted EXECUTE permission
> on SP1.
>
> It assumes a stored procedure named 'SP1' exists in a
> catalog 'SBS_dev' on 'apollyon\VSdotNET'. You can change
> these constants easily in the function 'connectToDB'.
>
> If you prefer, I can send the executable itself. Just let
> me know which data-source to connect to.
Thanks for the code! It's not only of this interest for this case, but
I may use for a sample for OLE DB programming some time in the future.
I was able to reproduce the problem on my SQL2000 Developer Edition,
but I don't think this is a bug. Then again, I don't have the full grip
of ownership chains, so maybe other people can supplement my findings.
What I found, using the SQL Server Profiler, is that behind the scenes
SQLOLEDB constructs a prepared query. This is the text for the event
RPC:Starting
declare @P1 int
set @P1=NULL
exec sp_prepexecrpc @P1 output, N'dbo.SP1'
select @P1
Then there is an SP:Starting event with this text:
exec sp_prepexecrpc
Please don't ask me about the find details of sp_prepexecrpc. :-)
I would guess, that what you really want is a true RPC call, and you
don't want any sp_prepexecrpc popping up behind your back. How you
achieve this with the SQLOLEDB provider, I don't know. But I seem
to recall having seen similar unwanted effects when using {} notation
from ADO.
-- Erland Sommarskog, SQL Server MVP, sommar@algonet.se
- Next message: Erland Sommarskog: "Re: Update statement"
- Previous message: Leon Parker: "Update statement"
- In reply to: Eran: "Re: EXECUTE permission denied on nested procedure call"
- Next in thread: Eran: "Re: EXECUTE permission denied on nested procedure call"
- Reply: Eran: "Re: EXECUTE permission denied on nested procedure call"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|