Jason Follas.com

Page History: SQL Server XML Tricks

Compare Page Revisions

« Older Revision - Back to Page History - Newer Revision »

Page Revision: 2007/08/17 09:17

An audience member wanted to query the XML data stored in a table in order to compare the list of elements from the XML in one row to another (presumably to detect if the untyped XML's "schema" changed from one row to another). Here's a way to generate a SQL table structure containing the namespace, local names, and parent's name for each element found in the table's XML. Once in this flat form, traditional SQL querying can be used to detect the changes.

Extract Element Names

ScrewTurn Wiki version 2.0.13. Some of the icons created by FamFamFam.