Stored procedure EXEC vs sp_executesql difference?

后端 未结 4 1817
逝去的感伤
逝去的感伤 2020-12-03 06:58

I\'ve written two stored procedure one with sp_executesql and other doesn\'t have sp_executesql both are executing properly same results, I didn\'t get what is

4条回答
  •  旧时难觅i
    2020-12-03 07:23

    With Exec You can't have a place holder in your T-Sql statement string.

    sp_executesql gives you the advantage of having a place holder and pass the actual value at runtime

提交回复
热议问题