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

前端 未结 7 1494
情话喂你
情话喂你 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 03:11

    I know this is already been answered but in SQL server the function is not suppose to change the data but the procedure is meant to.

    In addition to this i like to add that we cannot select a procedure or put it in a where clause but we can do this with a function.

    We use function to shorten the code so its greatly helpful as it reduces a lot of query for the coder.

    Hope this helps.

提交回复
热议问题