Can we perform Insert/Update/Delete
statement with SQL Server Functions
. I have tried with but SQL Server error is occured.
Error:
Invalid use of side-effecting or time-dependent operator in 'DELETE' within a function.
AnyBody have any Idea why we can not use Insert/Update/Delete
statements with SQL Server functions.
Waiting for your good idea's
No, you cannot. From SQL Server Books Online: User-defined functions cannot be used to perform actions that modify the database state.
Q #1) What is INSERT, UPDATE, and DELETE in SQL? Answer: The INSERT, UPDATE, and DELETE are commands in SQL which help to operate and update data. The INSERT statement inserts rows to a table. DELETE statement deletes rows from a table and the UPDATE statement updates values in the rows of the table.
The following SQL stored procedure is used insert, update, delete, and select rows from a table, depending on the statement type parameter. Now press F5 to execute the stored procedure.
No, you cannot.
From SQL Server Books Online:
User-defined functions cannot be used to perform actions that modify the database state.
Ref.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With