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?

3 Answers 3


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.

  • Thaks for the perfect answer...
    – Jishnu A P
    Commented Mar 1, 2011 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.


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


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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