Using XML Datatype is SQL SERVER

The xml data type lets you store XML documents and fragments in a SQL Server database. 

The below shows how to add a new column of XML datatype

ALTER TABLE Employee ADD JobHistory XML

The below shows how to Store the data in a XML column

UPDATE Employee SET JobHistory=
'< Job JobID="1" >
< CompanyName>ABC Corp< /CompanyName>
< Years>1< /Years>
< /Job>
'
WHERE EMPLOYEEID = 1

Comments

Popular posts from this blog

Jesus - God Thinks of you.

ASP.NET 4.0 Feature - URL Routing

Tips on JQuery Intellisense in VS 2008