GET_BIT
bit-level operation
What changes
- Input
- integer or binary arguments
- Output or change
- computed value
- Return type
- bit The bit_offset parameter in GET_BIT is used to identify the nth bit of the data to get or set. In integer types, the 0th bit is the least significant bit. In binary types, the 0th bit is the least
Syntax at a glance
GET_BIT ( expression_value , bit_offset )
Work example
Read one zero-based bit position from a supported value.
Try zero, the lowest bit, the highest bit, and a negative value of the same SQL type.
Check your work Offset zero is the least significant bit and the result depends on input width.
Open Microsoft Learn for full syntax, permissions, and details for your version.