• Patibandla (7/2/2013)


    What if i define @s-2 as BIGINT

    According to BOL, [Bitwise Operations (Transact-SQL) bitwise operations don't support bigint; in practise (in SQL 2012 anyway) you can mix and match bit, tinyint, smallint, int, and bigint freely with bitwise AND, bitwise OR, and bitwise XOR. I suspect that this is an error in BOL and bigint actually is supported, but it would be risky to use bigint with bitwise operators for production without confirmation from Microsoft that this is the case. There's a community comment on the page that saying that bigint works, but MS don't appear to police those at all.

    Tom