bit (data type)
data type bit
What changes
- Input
- none
- Output or change
- none
Syntax at a glance
bit
Work example
Store a two-state flag when null does not need to represent an unknown state.
Use NOT NULL with a default for a required flag and define the meaning of each state.
Check your work A nullable bit has three states because null is distinct from zero and one.
Practice SQL
Open in SQL FlowSELECT CAST(1 AS bit) AS is_enabled;
Open Microsoft Learn for full syntax, permissions, and details for your version.