sql server中bit字段实现取反操作

update Fct_StockMove set Disabled=Disabled^1 WHERE MoveId='DCE268E0-2CB3-4D17-AC4E-0046FB459CAD'; 

1.使用取反操作符 
update t1 set c1=~c1; 

2.使用异或操作符  ,适用于int类型操作
update t1 set c1=c1^1; 

3.使用算术方法实现 
update t1 set c1=(c1+1)%2; 
或者 
update t1 set c1=abs(c1-1); 

4.case when语句 
update tableName set state= 
(case state when 0 then 1 when 1 then 0 else 0 end); 

源文:http://yimenghust.iteye.com/blog/1601707

原文地址:https://www.cnblogs.com/shy1766IT/p/9036285.html