Using XML To Send Multiple Rows At Once Into A Stored Procedure
From time to time, people ask the question "How can I insert many records at once into SQL Server?" The purpose of this quick article is to describe that process in very basic details. I'll give a very simple example, so that you can then take it from there.
I find that it's easiest to visualize if you start with a very simple XML document. Here is an example XML snippet:
<items>
<item id="1"></item>
<item id="4"></item>
<item id="12"></item>
<item id="112"></item>
<item id="234"></item>
<item id="605"></item>
</items>
Let's say you have a checkboxlist, and you want to send the...