SQL Server 2008 - Editing Tables: Bit columns require 'True' or 'False'

Posted by CJM on Stack Overflow See other posts from Stack Overflow or by CJM
Published on 2008-12-04T16:22:19Z Indexed on 2010/03/11 5:13 UTC
Read the original article Hit count: 436

Not so much a question as an observation...

I'm just upgrading to SQL Server 2008 on my development machine in anticipation of upgrading my live applications. I didn't anticipate any problems since [I think] I generally use standard T-SQL, and probably not too far from ANSI standard SQL. So far so good, but I was really thrown by a very simple change:

I was creating a simple, small look-up table to store a list of codes and including a bit column to indicate the current default code. But when I used the new/modified 'Edit Top 200 Rows' option, and entered my 0s and 1s in the the bit column I got an error:

'Invalid value for cell - String was not recognised as a valid boolean'

After a bit of head-scratching, I tried True and False - and they worked.

So it seems this new Edit feature requires 4 or 5 characters to be typed, rather than the previous 1.

Checking further, we can still use '...where bitval = 1' but can now also use '...where bitval = 'true''. But any results returned render these bit columns as 0 or 1 still.

It all sounds like half a step backwards. Not the end of the world, but and unnecessary annoyance.

Does anybody have any insight on this issue? Or there any other new Gotchas with SQL Server 2008?

© Stack Overflow or respective owner

Related posts about sql-server

Related posts about sql-server-2008