Are there reasons for not storing boolean values in SQL as bit data types?

后端 未结 11 1631
北恋
北恋 2020-12-29 02:44

Are there reasons for not storing boolean values in SQL as bit data types without NULL? I see them often stored as integers without constraints to limit values to 0 and 1,

11条回答
  •  天命终不由人
    2020-12-29 03:02

    BIT is the datatype normally used to store BOOLEAN values. Simply because if the BIT is 1 then its true and 0 then its false. It is that simple.

提交回复
热议问题