Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 196
  • Last Modified:

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

0
dsk1234
Asked:
dsk1234
  • 2
  • 2
1 Solution
 
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
 
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

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now