XML strings and boolean values in SQL Server 2000

written by Ryan Olshan on Thursday, June 05 2008

I ran across this issue at work. When passing a boolean value in the form of true/false and not 1/0 in an XML string to SQL Server, SQL Server 2000 doesn't have the ability to convert true to 1 and false to 0. This is not the case with SQL Server 2005. The solution is to either convert true to 1 and false to 0 before passing in the XML string or do some manipulation in the form of a case statement to transform true to 1 and false to 0. Otherwise, you'll get an error that SQL Server is unable to convert varchar value true or false to type bit.

Kick this post on .NET Kicks

Similar Posts

  1. Nullable Types
  2. GridView without DataSourceControl DataSource
  3. VB.NET GridView Sorting/Paging w/o a DataSourceControl DataSource

Post a comment