XML is one of the data types in SQL Server 2005 and 2008.It is considered as one of the significant changes introduced in SQL Server 2005.In the previous versions, storing and retrieving XML data were possible but it was not as easy and extensible as it is in the current version. The XML data type lets the user to store XML data in the SQL Server database. In this article we will be discussing how to store, retrieve and query XML data.
Let’s now take a look at an example. This example demonstrates how to create a table that contains an XML column. We will also insert some records into the table.
1. Create table with XML column
Create table Product(ProductID int,ProductName varchar(50),ProductDetails XML)
2. Insert valid XML data into the table:
Insert into Product values(1,’Parker‘,’
3. We can also create variables of XML type.
Declare @x xml
SET @x =’
Insert into Product values(1,’Parker‘,@x)
September 3rd, 2009 at 7:24 am
What are the words … super, wonderful phrase