In this article you will learn how to insert bulk data into a single table in SQL Server using xml as the data type.
Today I will show you how to insert bulk data into a single table in SQL Server using a XML data type.This article will solve the following problems:
Here we go.SQL DATABASEStep 1Create an “Employee” table as shown in the following figure.Step 2Create a Stored Procedure (SP) that will take XML data type as a parameter. This SP will parse XML data and insert it into an “Employee” table. Here is the SP.ASP.NETStep 1This is the insert function that will pass data table as a parameter to the SP. See the following image.Here is my function that will convert a data table to XML.OutputScreen 1Screen 2Screen 3Screen 4NOTE: You can download the code to understand the concept better.
Hands on ASP.NET GridView