What value could I insert into a bit type column?

James Chen picture James Chen · Apr 1, 2013 · Viewed 133.2k times · Source

statue typethe situationI am trying to insert or edit the bit value to "0" or "1", but either returns me a blank.

Could someone tells me how to insert the value in it?

Also, Is that possible to not use bit type but Boolean? I see there's a Boolean type in the list of types

Thanks

Hi, I have uploaded the picture, the cell in the table is blank, but I have tried several times, add, update, all take effect, but cell keeps blank...

Answer

Kermit picture Kermit · Apr 1, 2013

Generally speaking, for boolean or bit data types, you would use 0 or 1 like so:

UPDATE tbl SET bitCol = 1 WHERE bitCol = 0

See also: