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

后端 未结 11 1635
北恋
北恋 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:17

    what typically happens down the road is that someone wants to add also a maybe to yes and no, if you have a bit then now you have to change all your code to tinyint

    if you had tinyint to begin with then you don't.....believe me this happens more than you think

提交回复
热议问题