비트 연산자(Transact-SQL)

비트 연산자는 두 식 사이의 비트 조작을 수행합니다. 이 때 식에는 정수 데이터 형식에 속하는 모든 데이터 형식을 사용할 수 있습니다.

연산자

의미

&(비트 AND)

비트 AND(두 피연산자)

|(비트 OR)

비트 OR(두 피연산자)

^(배타적 비트 OR)

배타적 비트 OR(두 피연산자)

비트 연산자의 피연산자는 정수 또는 이진 문자열 데이터 형식(image 데이터 형식은 제외)에 속하는 모든 데이터 형식이 될 수 있습니다. 단, 두 피연산자가 모두 이진 문자열 데이터 형식이어서는 안 됩니다. 다음 표에서는 지원되는 피연산자 데이터 형식을 보여 줍니다.

왼쪽 피연산자

오른쪽 피연산자

binary

int, smallint 또는 tinyint

bit

int, smallint, tinyint 또는 bit

int

int, smallint, tinyint, binary 또는 varbinary

smallint

int, smallint, tinyint, binary 또는 varbinary

tinyint

int, smallint, tinyint, binary 또는 varbinary

varbinary

int, smallint 또는 tinyint

참고 항목

참조

연산자(Transact-SQL)

데이터 형식(Transact-SQL)