Click here to Skip to main content
15,886,810 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hi, I want to insert multiple rows using one stored procedure.
my current insert statements like that

squery = "insert into pricing values('I', getdate(), 'msg 0 goes here');"

squery += "insert into pricing values('B', getdate(), 'msg 1 goes here');"

squery += "insert into pricing values('C', getdate(), 'msg 2 goes here');"

VB
sqlcommand.CommandText = squery
      Try
          sqlcommand.ExecuteNonQuery()


now i tried to switch to stored procedure it work if i am entering one record only but i can't get it to insert multiple
squery =InsertSP 'C', 'MSG'; 

squery +=InsertSP 'V', 'MSG'; 

it gives me error and tells me there is error in the syntax
Posted
Updated 11-Oct-12 5:37am
v2

1 solution

If only there was a way to search Code Project to find suitable articles...

Here is one way: How to pass multiple records to a Stored Procedure[^].
 
Share this answer
 
Comments
Mike988 11-Oct-12 14:40pm    
Thank you

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900