So I got a varbinary(max)
column in SQL Server 2005 and it's full of XML. A few records somewhere have truncated XML so they're invalid.
This means if I run a
SELECT CAST(myVarbinaryColumn as XML) ...
it blows chunks.
How can I filter out/skip invalid xml ?
When I've done similar with a varchar that supposedly has dates I could use ISDATE(blah) = 1
. So an equivalent ISVALIDXML()
would be nice.
Please don't comment about "Why isn't the column XML datatype anyway.." This happened in the past and I don't have a time machine.