I have a question ,with respect to executing the stored procedures. can we execute a single stored procedure multiple times like
say about a 100 times in a single script
If yes... 1) is there a limit that the procedure could be called in the script
2) what is the efficient way to do it. I am thinking of writing another stored procedure which executes this procedure required number of times.
I am not sure how to handle this situation. Any advice would be very helpful.
asked Aug 23, 2010 at 09:59 AM in Default
This will execute it 100 times
<!-- Begin Edit
Here is the sample to do it with the cursor loop. I will use simple xml to store the procedure parameters, so I don't have to create a temp table:
Suppose I want to execute the proc few times each time with different parameters. I can store the parameter values in the xml , open the cursor reading data from it and executing the proc once per cursor loop step:
End Edit -->
Here si th example I created...
It is running fine, but it gives an error message "The query has exceeded the maximum number of result sets that can be displayed in the results grid. Only the first 100 result sets are displayed in the grid."
But if you are trying to update the data, i dont think you are going to have any problem.
Thank you Vpadmala