Change SQL Server bit field to the opposite value using ~

Category SQL Sub Category Language TSQL
Bookmark and Share
In sql server you can flip the bit field value by using the ~ (tilde) operator
For example if you had a bit column called IsActive you would call the column as

Copy Code
select ~IsActive AS NotActive

To get the opposite boolean value
Share the love
Bookmark and Share