Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

i use SQL server 2008 in my web application back end. Apparently i iterate through all the records from the C# code whenever there is a multiple insertion scenario. i have never tried the multple insertion using XML. And i think after reading many blogs about XML manipulation using SQL server 2008 the process is pretty tideous .. So my question is..

  • Is Insertion via XML much efficient than the traditional insertion?
  • Is the a generic way in which i can serialize a class in C# --> Manipulate XML in SQL -->Insert also Read data as XML--> Deserialize XML to usual object?
share|improve this question
up vote 4 down vote accepted

The whole "inserting multiple records with XML" has pretty much been superseded by table parameters in SQL Server 2008.

And mentioned in Erland Erland Sommarskog's Arrays and Lists in SQL Server 2008: the definitive article on this subject.

.net has better XML handling than the SQLXML implementation too.

share|improve this answer
Thaks for the perfect answer... – TheSupertramp Mar 1 '11 at 4:41

While TVPs would be a better solution, this can be done via XML as well. I talked about it a while back in an article and my blog.

share|improve this answer
Many thanks.... – TheSupertramp Mar 1 '11 at 4:41

You might want to look into Table-Valued Parameters instead.

share|improve this answer
Many Thanks.... – TheSupertramp Mar 1 '11 at 4:42

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.