ramlicious Blogs by Tina & Prabhu

September 29, 2010

Importing and Querying Typed XML in SQL Server

Filed under: SQL Server — Prabhuram @ 2:59 am

Here is a clear example that demonstrates how to import XML data to SQL table objects and query them. It includes:

The sample XML schema (sdn.xsd) and XML data (sdn.xml) used in this example are taken from SDN List provided by US Department of Treasury. More about the SDN List is available here.

The complete sample is available for download here sdn.sql (1.51 kb) (change the xsd and xml paths in sdn.sql before running it). This uses the [northwind] database and can be changed if required. Also note that the variables used within (commented) can be changed to nvarchar if necessary.

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

You must be logged in to post a comment.

Powered by WordPress