UDF's should not be thought of as a replacement for sp's. Usually if you
can do what you want in a sp without difficulty then you should use a sp.
Save the UDF's for operations that just can't be done with a sp. Usually
these operations are when something has to be applied to each and every row
of the result set and this can be slow. While not all UDF's are slow you
will find the sp to be faster in most cases for the same effect.
Andrew J. Kelly
SQL Server MVP
"Yibing Wang" <com> wrote in message