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

后端 未结 11 1626
北恋
北恋 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 02:55

    I see them often stored as integers without constraints to limit values to 0 and 1, and as strings with things like T/F, True/False, yes/no, etc., again without constraints. Isn't it better to store them as bits and not have to worry about additional constraints?

    Yes!

    What am I missing here?

    Actually it should be "what am I NOT missing here?" and the answer would be: common sense.

提交回复
热议问题