Forum Discussion
davidz106
4 years agoHelper III
Passing a parameter to SQL stored procedure - LOOP
I am calling SQL stored procedure: let source= Sql.Database("server", "database", [Query="EXEC procOderBySampleID ID = '"&sample&"'"]), sample = #"sample input", and in parameter "sample input...
v-kkf-msft
4 years agoCommunity Support
Hi davidz106 ,
We can't automatically generate a separate query for each ID. I can do is add a custom column to the ID list and call stored procedure for each ID in this column.
= Sql.Database(".", "CaseTest", [Query="EXEC GetProductDesc_withparameters @PID = '" & [ID List] & "'"])
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.