Why can we not execute a stored procedure inside a function in SQL Server

前端 未结 7 1532
情话喂你
情话喂你 2020-12-17 02:23

Why can we not execute a stored procedure inside a function when the opposite is possible?

7条回答
  •  我在风中等你
    2020-12-17 02:49

    We cannot call store procedure within a function. However, we can call a function within a store procedure.

    Functions are extremely limited. They cannot perform any operation in any way that can change data. This means that you can't use dynamic sql or call other objects (except functions)

提交回复
热议问题