Q1) why dml operations are not allowed in user defined functions for database tables?
Q2) Why cannot we have non deterministic functions e.g. getdate() in UDF?
Q3) Why functions cannot use ntext, image and timestamp data types as return type?
Q4) Why cannot a function have output parameter?
Q5) Why we cannot use Try..Catch block inside a function?
Q6) Why Temporary table (#temp) and Derived table cannot be created on function?
Q7) Why cannot we use print statement in udf?
Q8)We cannot call stored procedures(exception for Extentended stored procedures ) from udf. Why?Thanks in advance...
Here's my attempt to answer your questions.
I forgot to post the example of derived tables in UDF. Here it goes.