UDF that return non-deterministic values are not allowed to be called from inside UDF
GETDATE is an example of a non-deterministic function. Every time the function is called, a different value is returned.
Not every SQL statement or operation is valid within a function.
The following lists enumerate the valid and invalid function operations:
Valid:
Assignment statements
Control-flow statements
Variable declarations
SELECT statements that modify local variables
Cursor operations that fetch into local variables
INSERT, UPDATE, DELETE statement that act upon local table variables
Invalid:
Built-in, nondeterministic functions such as GetDate()
Statements that update, insert, or delete tables or views
Cursor fetch operations that return data to the client