Call a stored procedure in multi scalar table-valued function?

前端 未结 3 1940
北荒
北荒 2021-01-20 11:37

Is there any way to call a stored procedure in multi scalar table-valued function like that?

Note: this query returns error:

3条回答
  •  囚心锁ツ
    2021-01-20 12:15

    Functions can't have side effects i.e. change data.

    Even if your stored procedure doesn't change anything, the SQL compiler can't assume that, So it just doesn't allow it.

    Why do you need to wrap this in a function?

提交回复
热议问题