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

前端 未结 3 1933
北荒
北荒 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 11:52

    You cannot execute a stored procedure in a function.

    0 讨论(0)
  • 2021-01-20 11:57

    I resolved this problem. I wrote a table-valued function including executable query, returns table and prepared an stored procedure to call that function passing parameters. It works for me.

    0 讨论(0)
  • 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?

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