Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mulit insert to sql

Status
Not open for further replies.

xponcall

IS-IT--Management
Aug 1, 2007
9
US

I'm trying to limited many network round-trips call from the ASP.NET.
What is the best method to insert these into the table:

Customer Order:
items,qty,price,desc:

102, 1, 250, 'Sql books'
105, 2, 10, 'Book binder'
106, 1, 5, 'Special Pen'
110, 5, 2, 'Paper Box'

I looking into Array and pass the values to SQL, but looking for everyone input before I go on futher.

thanks
 
You may want to consider using XML to pass the data to SQL Server. You can then parse the XML and insert multiple records from one stored procedure call.

For an idea on how this might be implemented...
thread220-1249932

This would work for SQL2000 and/or SQL2005.



-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
George,

thank you for the quick response. I'm a bit rusty with XML and not can't afford to learn the stuffs right now, because of the time limited on the project.

thanks
 
Learn what? XML? I wasn't necessarily recommending that you learn everything there is to learn about XML. I thought the example I showed was pretty straight-forward. There really wouldn't be the much to learn in order to make use of the method I described.



-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top