Re: Executing dynamic select statement in a SP
From: Dan Guzman (danguzman@nospam-earthlink.net)
Date: 12/30/02
- Next message: Brian: "Linked SQL Servers"
- Previous message: Sue Hoegemeier: "Re: Executing dynamic select statement in a SP"
- In reply to: Chen: "Executing dynamic select statement in a SP"
- Next in thread: John Bell: "Re: Executing dynamic select statement in a SP"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
From: "Dan Guzman" <danguzman@nospam-earthlink.net> Date: Mon, 30 Dec 2002 08:30:41 -0600
Dynamic SQL is always executed in the security context of the executing
user. You need to use static SQL if you need to leverage ownership
chains.
Check out Erland's article on dynamic SQL considerations
<http://www.algonet.se/~sommar/dynamic_sql.html>
-- Hope this helps. Dan Guzman SQL Server MVP ----------------------- SQL FAQ links (courtesy Neil Pike): http://www.ntfaq.com/Articles/Index.cfm?DepartmentID=800 http://www.sqlserverfaq.com http://www.mssqlserver.com/faq ----------------------- "Chen" <cshn@yahoo.com> wrote in message news:030201c2b00c$1324cc30$89f82ecf@TK2MSFTNGXA01... > Hi all, > > I have a SP which has dynamic SQL statements. I have given > the execute only permission to couple of users on this SP. > These users do not have any permission on the tables > referred inside the SP. If I do not use the dynamic SQLs > everything works just fine but with dynamic SQLs when I > execute them in the SP I get select permission denied to > tables. This is urgent. Any help is appriciated. > > Thanks in advance > > Chen
- Next message: Brian: "Linked SQL Servers"
- Previous message: Sue Hoegemeier: "Re: Executing dynamic select statement in a SP"
- In reply to: Chen: "Executing dynamic select statement in a SP"
- Next in thread: John Bell: "Re: Executing dynamic select statement in a SP"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|