invalid use of a side-effecting operator ‘insert’ within a function. sql server

User-defined functions cannot be used to perform actions that modify the database state.

“Modify the database state” includes changing any data.

You should be using a stored procedure, not a function

Leave a Reply

Protected with IP Blacklist CloudIP Blacklist Cloud