Monthly Archives: March 2007

Save Xml Document Created by FOR XML with XmlNamespace

/* When creating xml document by FOR XML PATH ( or AUTO, RAW etc), we can save the generated xml document to a xml data type variable by specify the TYPE directive. E.g.: */ DECLARE @Orders xml; SET @Orders=( SELECT … Continue reading

Posted in SQL server 2005 | Leave a comment

Shred complex XML by XQuery node() and value() methods

 /* XQuery nodes() method allows you to identify nodes that will be mapped into a new row. Its result is a rowset that contains logical copies of the original XML instances. XQuery has value() method that can be used to … Continue reading

Posted in XML, XQuery and XPath | Leave a comment

Convert xml datetime (xs:dateTime) to SQL datetime

/* SQL Server 2005 supports xquery as the DML on xml data. The value() method is used to retrieve the value of attributes and element of xml in SQL Server 2005. However, the datetime data type in xml xs:dateTime is … Continue reading

Posted in SQL server 2005 | 3 Comments