Performing BitWise operator in SQL

Bageshkumarbagi
Posted by Bageshkumarbagi under Sql Server category on | Points: 40 | Views : 648
Hi,

USE TestBackUp
GO
IF

EXISTS (SELECT * FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME = 'bitwise')

DROP TABLE bitwise
PRINT 'Table Allready Exit'
GO

CREATE TABLE bitwise
(
a int NOT NULL,
b int NOT NULL
)
GO
INSERT bitwise VALUES (70, 75)
GO

USE TestBackUp
GO
SELECT a & b As 'BitWise And Value',
a | b As 'BitWise Or Value'
FROM bitwise
GO

OutPut

BitWise And Value BitWise Or Value
66 79

Comments or Responses

Login to post response