Link to home
Start Free TrialLog in
Avatar of dsk1234
dsk1234

asked on

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

Avatar of Bhavesh Shah
Bhavesh Shah
Flag of India image

Hi,

what yo u can do is.....

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

If you can share your proc den we can help you out....
Avatar of dsk1234
dsk1234

ASKER

without modifying existing  store proc , while executing can we achieve ?
ASKER CERTIFIED SOLUTION
Avatar of Nico Bontenbal
Nico Bontenbal
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial