• Jan Van der Eecken (4/15/2009)


    Douglas, you are quite correct when you say that MSDN lists all of the above as built-in functions that cannot be used in a UDF because they are non-deterministic. However, you should note that in the heading of the article it also says Creating and Maintaining Databases (SQL Server 2000). Under SQL 2K8 (and presumably SQL2K5 as well, didn't try that) only two of those can not be used, namely RAND() and NEWID(). So, the limitation these days is really that one cannot use built-in functions that potentially may have side-effects.

    Thanks for the correction Jan. I didn't even pay attention to the version that the text was for when posting my note. I just blindly used the link provided as the reference. It would be nice if the questions listed which version of SQL they pertained to since there are situations where an answer could be different based off the version.

    Thanks to these questions and people like yourself posting on these boards I have learned more about SQL than I would have done on my own.