Thank you for responding Andrew.
Thank you for the link ... I had read that link before and it was helpful.
However, I believe I already understand why it is failing (my take): Since
the Impersonating User only has access to run a SP, and since SP_EXECUTESQL
is really building/creating and running a separate SP it does not have access
to run it. (The error is receives is that is does not have access to the
Object "Whatever Table"), This makes sense to me.
My question really is more of a:
Since the DBA only wants to grant access to the Impersonating User to
execute the SP (which is understandable) and since I want to (in certain
occasions) create Dynamic SQL (SP_EXECUTESQL) .... how can we make both
situations work where we're both happy?
Thank you
t
> Thank you for the link ... I had read that link before and it was helpful.
>
[quoted text clipped - 10 lines]
> occasions) create Dynamic SQL (SP_EXECUTESQL) .... how can we make both
> situations work where we're both happy?
First, I don't really know what your impersonating user comes from, but
I suppose that is specific to your setup. Maybe you could give some more
details, in case this could be relevant for the issue?
The solution I recommend in my article is to sign the procedures with a
certificate. Any reason this would not work for you? Of course, you would
still need to convince your DBA that this is a sound way to go.

Signature
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Franky - 29 Feb 2008 15:24 GMT
Hi,
Your DBA changed the security rules so that a user can only execute stored
procedures and no longer have rights to the tables and views.
We are also developing our websites and applications with this rule.
So we also bumped into your problem.
We've been helped by the content in the links of Erland Sommarskog (thx).
Basicaly what you have to do is :
- create a certificate in the database
- create a user from that certificate
- give that user the necessary rights on your tables/views that are
necessary to execute your sp_executesql statement
- sign your stored procedure with that certificate ( add signature to ...)
> > Thank you for the link ... I had read that link before and it was helpful.
> >
[quoted text clipped - 18 lines]
> certificate. Any reason this would not work for you? Of course, you would
> still need to convince your DBA that this is a sound way to go.