Export (0) Print
Expand All
1 out of 3 rated this helpful - Rate this topic

Bitwise Operators (Transact-SQL)

Bitwise operators perform bit manipulations between two expressions of any of the data types of the integer data type category.

Operator Meaning

& (Bitwise AND)

Bitwise AND (two operands).

| (Bitwise OR)

Bitwise OR (two operands).

^ (Bitwise Exclusive OR)

Bitwise exclusive OR (two operands).

The operands for bitwise operators can be any one of the data types of the integer or binary string data type categories (except for the image data type), except that both operands cannot be any one of the data types of the binary string data type category. The following table shows the supported operand data types.

Left operand Right operand

binary

int, smallint, or tinyint

bit

int, smallint, tinyint, or bit

int

int, smallint, tinyint, binary, or varbinary

smallint

int, smallint, tinyint, binary, or varbinary

tinyint

int, smallint, tinyint, binary, or varbinary

varbinary

int, smallint, or tinyint

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.