[quoted text, click to view] Stu wrote:
> Not sure what you mean by "Are you the OP?";
>
> I recognize that there are certain limitations to using dynamic SQL,
> and that for 90% of the time when one might be tempted to use it, you
> don't really need it. However, it is a tool that can be used to solve
> certain business problems, and I don't think you should approach a
> business problem saying "I'm NOT going to use this tool"; you should
> always look at using the best solution for the problem, even if it's
> one that shouldn't be used in 90% of the situations.
>
> Granted, the scenario described above is one that I probably wouldn't
> use dynamic SQL, but since I don't know the whole backstory, I
> wouldn't rule anything out.
>
OP = Original Poster... You wrote "My question is why would you NOT want
to use dynamic SQL" which made me think that original post (name of
Boomessh) was you. I couldn't tell if it was, so I just predicated my
post with that question.
I agree with your comments philisophically, but disagree when it comes
to dynamic SQL. The "limitations" as you put it are more profound than a
single statement that makes use of dynamic sql. Once you use it in an
database, even just once, the underlying objects are exposed to all
users/groups who need to run the SQL statement (this will be addressed
in SQL Server 2005 when run from a stored procedure). And for DML
operations, that just isn't acceptable for most systems that must be
locked down as best as possible. On systems that allow access to the
underlying objects and use embedded SQL, using dynamic SQL is probably
not much of an issue. But in an age where security is a paramount
concern of businesses, I'd hate to be the one responsible for allowing
access to the Customer table and exposing all that data to someone
simply issuing a "SELECT * from Customers".
--
David Gugick
Quest Software
www.imceda.com www.quest.com