You are here: Re: sp_ExecuteSQL in User Defined Function « MsSQL Server « IT news, forums, messages
Re: sp_ExecuteSQL in User Defined Function

Posted by Erland Sommarskog on 07/21/05 01:14

Highlander416 (rbradford@gmail.com) writes:
> Does anyone have any ideas as to how I can dynamically execute this
> query? The reason I say dynamic is I need this same comparison for
> about 25 different tables. Thanks!

You cannot invoke dynamic SQL from a user-defined function.

I don't really get a grip of what you are trying to do. Even less why.
And that would be kind of interesting to know.

Because, normally, if find yourself wanting to do such a thing, it's
a strong indication that there is a problem with the data model. Then
again, it could be OK, if this is for some special purpose, for instance
auditing or reconciliation, and part of the main application code.

If you can expand on the underlyingh business problem you have, it may
be easier to suggest a strategy.

--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация