如何取反 SQL Server Compact 的 SET 子句中的值?
How do I negate a value in a SET clause for SQL Server Compact?
UPDATE [MyTable]
SET [MyBoolColumn] = NOT [MyBoolColumn]
这不适用于 SQL Server CE。错误是
There was an error parsing the query. [Token in error = NOT]
那么我该如何让它发挥作用呢?
DECLARE @MyTable TABLE (MyBoolColumn BIT)
INSERT INTO @MyTable (MyBoolColumn)
VALUES (0), (1)
UPDATE @MyTable
SET MyBoolColumn = ~MyBoolColumn
SELECT * FROM @MyTable
结果 -
------------
1
0
UPDATE [MyTable]
SET [MyBoolColumn] = NOT [MyBoolColumn]
这不适用于 SQL Server CE。错误是
There was an error parsing the query. [Token in error = NOT]
那么我该如何让它发挥作用呢?
DECLARE @MyTable TABLE (MyBoolColumn BIT)
INSERT INTO @MyTable (MyBoolColumn)
VALUES (0), (1)
UPDATE @MyTable
SET MyBoolColumn = ~MyBoolColumn
SELECT * FROM @MyTable
结果 -
------------
1
0