The AdventureWorks Data Dictionary specifies that the [EmailPromotion] column in the [Contact] table is an int and that:
0 = Contact does not wish to receive e-mail promotions.
1 = Contact does wish to receive e-mail promotions.
and [Employee].[CurrentFlag] uses bit as follows:
0 = Inactive
1 = Active
My question has two parts:
- Is there a good reason to use the
intdatatype in placebit(both uses will be documented)? - What naming conventions for boolean and boolean-like columns do you recommend? (e.g. IsActive, ActiveFlag, Active)
For the first part they are probably allowing for future status codes (although with that column name it is hard to imagine what that could be…).
You will find a lot of dissent on your second question, but I prefer
IsActiveas a name in this case. I find it reads well, and prevents double negatives in code that you would get if you used something likeIsInactive.