Insert query in SQL Function

前端 未结 1 1345
梦毁少年i
梦毁少年i 2020-12-17 06:34

Can i write a insert query inside Function in SQL server 2008. If i tried, im a getting an error of Invalid use of side effecting operator \'INSERT\' within the function. Pl

相关标签:
1条回答
  • 2020-12-17 06:44

    Quote from here:

    User Defined Functions cannot be used to modify base table information. The DML statements INSERT, UPDATE, and DELETE cannot be used on base tables.

    So you can't do an INSERT in a function.

    You might want to explain WHY you don't want to use a procedure.

    0 讨论(0)
提交回复
热议问题