Question Locked

How to send Variable number of parameters from vb.2005 to sql-server

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I have a problem regarding forwarding 'n number of parameters' from Visual Studio 2005 using VB to SQL-Server 2005 stored procedure.I have to save N number of rows in my stored procedure as a transaction. If all rows are not saved successfully, I have to roll-back else update some other table after that. I am unable to handle - How to send variable number of parameters from Visual Stduio to Sql - Server ? My requirement is use the SQL-Stored Procedure. Please Help .....

3 replies

by tony hopkinson

Stored procs can't have a variable number of parameters anyway.

You could send in a structure and then decode it in the SP (xml snippet would be my recomendation).

Or you could simply start a transaction client side, do the inserts 1 by 1 and then rollback on a failure.

Another option would be to set up a temporary table, insert to it. Then call an sp passing in the temp table name.

This discussion is closed to new replies.