A Solution For Stripping Invalid XML Characters From varchar/text Data Structures

One of the more subtle aspects of converting (n)varchar or (n)text data to XML is the fact that XML is choosy about which characters are permitted and (n)/varchar/(n)text is not.  Any T-SQL programmer who runs conversions of this type is likely to run into this issue.  Here’s a code block that resolves the issue. The…

6

SQL Server 2005 XQuery Performance Tips

During some recent Xquery performance work, three discoveries emerged which dramatically improved the performance of my team’s component.  I’d like to share them here.. Specify A Single Root Node The XML parser in SQL2K5 doesn’t assume that the XML it receives is well-formed.  It will therefore look for multiple occurrences of the root element in a…

3

Welcome!

Welcome to my new blog.  Perhaps I should start off by answering the old Admiral Stockdale question: who am I and why am I here? I’m a Senior Applications Developer in Microsoft’s internal IT department.  I’ve been designing and coding PC and mainframe databases since 1979, and I’ve worked on just about every platform there’s…

2