Friday, March 9, 2012

Negate a SQL Bit

Seems an easy questions, but how do I negate a SQL bit variable in SQL Server 2000? i.e. If the Bit is 1, I want it to be set to 0. Not that this is not a select, e.g.

SET @.b = 1
SET @.b = NOT @.b -- This line does not work.Does not matter - found it :

SET @.b = 1
SET @.b = ~@.b

No comments:

Post a Comment