Monday, 9 September 2013

FOR XML could not serialize the data for node because it contains a character (0x0001) which is not allowed in XML

FOR XML could not serialize the data for node because it contains a
character (0x0001) which is not allowed in XML

I am trying to use FOR XML for the first time in T-SQL on SQL Server 2008.
I am getting this error message for one of the columns in my big table:
FOR XML could not serialize the data for node because it contains a
character (0x0001) which is not allowed in XML. To retrieve this data
using FOR XML, convert it to binary, varbinary or image data type and use
the BINARY BASE64 directive.
I took a guess and tried this:
select * from db.dbo.table where colThatGeneratedError like '%0x0001%'
but it pulls no rows.
How can I find out what row in the table contains the invalid characters?
What character does 0x0001 refer to? To my eye that looks like hex for 1 =
decimal 1

No comments:

Post a Comment