CREATE FUNCTION UDF_DMLOperationTest()
INSERT INTO LocationTable VALUES(167,'XXX') -- we are trying to do DML operation inside a function
Above CREATE FUNCTION code gives this error: Invalid use of a side-effecting operator 'INSERT' within a function.
NOTE: This is one of rule we all should know.....
One more important thing is we can apply DML operation on table variable
inside a function