3 replies
by harkiratsin Accepted solution
by tony hopkinson Accepted solution
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.
by aikimark Accepted solution
Since you are using SQL Server 2005, you have decent support for XML as a data or parameter source in stored procs.
Here are some decent introductory links:
http://vyaskn.tripod.com/passing_arrays_to_stored_procedures.htm
http://weblogs.sqlteam.com/travisl/archive/2005/01/04/3931.aspx
http://www.topxml.com/xml/articles/sql2000
If you have a LOT of data to pass to the stored proc:
http://sqlxml.org/faqs.aspx?faq=61
This discussion is closed to new replies.
Trending Networks posts
Sort by Trending