Msg 443, Level 16, State 1, Procedure udfMyFunc, Line 5
Invalid use of side-effecting or time-dependent operator in ‘%s’ within a function.
This error message appears when you try to use an nondeterministic operator or an operator with side-effects within a user-defined function.
The T-SQL statement can be parsed, but causes the error at runtime.
Error of the Severity level 16 are generated by the user and can be fixed by the SQL Server user. The operator must be removed from the function. If that is not possible, consider changing the function to a stored procedure, if possible.
This error messages was introduced with SQL Server 2000.
CREATE FUNCTION dbo.udfMyFunc()
In the above example we use the nondeterministic RAND() function inside a UDF. This raises the error.
The classification of what is considered “deterministic” and what is “nondeterministic” is flowing. In SQL Server 2000, for example, you couldn’t use GETDATE() inside a UDF, while this is allowed in SQL Server 2005. When in doubt consult the BOL of the SQL Server version you use.
The text of this error message has changed from SQL Server 2000 to SQL Server 2005.]]>