开发者

SQL Server: How to execute UPDATE from within recursive function?

开发者 https://www.devze.com 2023-01-17 14:36 出处:网络
I have a recursive scalar function that needs to update a record in another table based on the value it is returning, however UPDATE statements are not allowed in the funct开发者_C百科ion.

I have a recursive scalar function that needs to update a record in another table based on the value it is returning, however UPDATE statements are not allowed in the funct开发者_C百科ion.

How can I update the table from within the function?


UPDATE statements are not allowed in the function

That's the rule - functions are not allowed to have any data-changing side-affects.

You have to use a Stored Procedure to UPDATE.

0

精彩评论

暂无评论...
验证码 换一张
取 消