stored procedure in sql server 2005

I have a stored procedure in sql server 2005 that takes 3 input parameters that will update

a table


My requirement is to update 6 records ie

exec samplesp '1','a','x'
exec samplesp '2','b','x'
exec samplesp '3','c','x'
exec samplesp '4','d','x'
exec samplesp '5','e','x'
exec samplesp '6','f','x'

In the above, instead of calling  stored proc 6 times, is there any better way we can do this calling once and updating all 6 records

dsk1234Asked:
Who is Participating?
 
Nico BontenbalCommented:
If the stored procedure is designed to update on record there is no way of telling it to update 6 records at 1 go without changing the stored procedure.
0
 
Bhavesh ShahLead AnalysistCommented:
Hi,

what yo u can do is.....

create 3 param as varchar and pass it as comma seperator....
0
 
Nico BontenbalCommented:
Here quite a detailed description of various techniques to do this:
http://www.sommarskog.se/arrays-in-sql-2005.html
0
 
Bhavesh ShahLead AnalysistCommented:
Hi,

If you can share your proc den we can help you out....
0
 
dsk1234Author Commented:
without modifying existing  store proc , while executing can we achieve ?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.