troubleshooting Question

ArrayList as parameter to SQL stored procedure

Avatar of Angel02
Angel02 asked on
Microsoft SQL ServerVisual Basic.NETSQL
14 Comments3 Solutions613 ViewsLast Modified:
I actually have to send an XML as a parameter to a SQL stored procedure but I am using SQL 2000 and it does not have XML datatype. The XML is like below

<productlist>
<product>abc3</product>
<product>xyz4</product>
<product>pqr2</product>
</productlist>

abc is the product code and 3 is the quantity. I need to insert product code and quantity in different columns of a table. I think I have two options

(1) Send the XML as varchar(8000) and do the split in the stored procedure.
This seems risky if the XML is more than 8000 characters.

(2) Do the split in my VB.NET application tht calls the stored procedure. Insert product code and quantity in separate arrays and send the arrays to stored procedure as parameters.

Which is the better option? Or is there any other way of doing it? Please advise and let me know how I can do it. Thanks!
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 3 Answers and 14 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 3 Answers and 14 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros