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

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

    one reason is that people don't know about bit or think that y/n is simpler for formatting. other reason is that sometimes you think: hmm maybe over time this will be more than a bool field. and you make it int just in case.

    you're not missing anything :)

提交回复
热议问题