Comma Separated Values from a table column, part 2: SUBSTRING limits the XML length, so I rewrote the query with STUFF and FOR XML PATH to remove it.
SQL SERVER – Validate an XML Document in TSQL using XSD by Jacob Sebastian
Jacob Sebastian shows how to validate an XML Document in T-SQL with XSD. An XML Schema Collection checks the structure and values of an XML column or variable.
SQL SERVER – Comma Separated Values (CSV) from Table Column
The script I use most often to build Comma Separated Values (CSV) from a table column with FOR XML PATH. I think XML is the best option for code and speed.
XQuery string-length: Count Content Without Markup
XQuery string-length counts the selected element string value. Seven bounded cases separate content from markup, empty elements from missing elements, and missing XML from existing documents.
FOR XML PATH: Choose Attributes and Nested Elements With Aliases
FOR XML PATH interprets column aliases as directions for the output’s attributes and element hierarchy. I use three aliases to shape two rows. The source columns stay ordinary relational values.
SQL SERVER – Practical SQL Server XML: Part One – Query Plan Cache and Cost of Operations in the Cache
A guest post from Michael Coles, author of Pro SQL Server 2008 XML: a practical XML demo that looks at the query plan cache and the cost of cached operations.
SQL SERVER – Simple Example of Reading XML File Using T-SQL
A simple example of reading XML file content using T-SQL: load the XML into a variable and pull out elements and attributes with value() in a SELECT.






