Re: Bug in SQLXML

From: Chris (a_at_abc.com)
Date: 03/09/04


Date: Tue, 9 Mar 2004 17:27:25 +0800

Hi Peter,

I can confirm that bug within SqlXml 3.0Sp1 I think b1. A joined table with
a bit column returns always 0 if the result of the query is rendered to XML
with "FOR XML NESTED" clause.

Two ways to get around:

1. Use the clause "FOR XML RAW" and render the output with a xslt style***
2. Use a cast statment for the bit colomn and render it to a string, e.g.
CAST(MyTable.Active AS NVARCHAR(1)) AS Active

Hope that helps.

Christian

"Peter Stokes" <anonymous@discussions.microsoft.com> wrote in message
news:D71A19B0-5431-4A9F-9B6A-82500725E4DC@microsoft.com...
> All,
>
> I have a stored procedure which joins three nested tables. When I use the
SQLXML managed classes for .NET to return this stored procedure as an
xmlreader something strange happens.
>
> In the top level table there is a boolean column. In the database the
value of this column in the rows being returned is 1. However in the xml
being returned the element has a value of 0. When I change the stored
procedure and only return rows from the top level table it returns the xml
correctly
>
> Has anyone else experienced this?
>