我想到的是這樣的:使用WHERE子句檢查相同的字段更新表字段是否安全?
UPDATE [MyTable]
SET [SomeField] = 1
WHERE [SomeField] is NULL
將它的工作或者是像修改集合在遍歷呢?
或者也許寫這樣的東西?
UPDATE [MyTable]
SET [SomeField] = 1
WHERE [ID] IN (SELECT [ID]
FROM [MyTable]
WHERE [SomeField] is NULL)