We are serializing custom business objects using XML serialization, shredding
them in a stored procedure in SQL 2005 in order to get the values into all of
the tables in one call. The problem comes when the data comes back out. We
are using FOR XML to get XML back out of the database using ExecuteReader
(.Net 2.0). Everything works fine until the business object that we are
thrying to deserialize creates a document larger than 2K.
At this point, the data is truncated and the deserialization fails. I am
assuming (but would like clarification) that, by default, UTF-8 is used by
the reader if it is not specified in the document being returned. If that is
the case, anyone know how to force it to UTF-16 using T-SQL? If that isn't
the case, any other ideas to keep the xml from being truncated on the way
back out? In SQL Management Studio all of the data is there, it is only when
the ExecuteReader gets a hold of it.
Thanks for the help!
Mike