SQL Server stored procedure parameters

前端 未结 5 1540
[愿得一人]
[愿得一人] 2020-12-08 07:09

I am developing a framework, where in I am a calling stored procedure with dynamically created parameters. I am building parameter collection at the runtime.

The pr

5条回答
  •  执笔经年
    2020-12-08 08:00

    Why would you pass a parameter to a stored procedure that doesn't use it?

    It sounds to me like you might be better of building dynamic SQL statements and then executing them. What you are trying to do with the SP won't work, and even if you could change what you are doing in such a way to accommodate varying numbers of parameters, you would then essentially be using dynamically generated SQL you are defeating the purpose of having/using a SP in the first place. SP's have a role, but there are not the solution in all cases.

提交回复
热议问题