Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何更新 SQL Server 2008 中的多条记录?我想运行以下查询,但失败了:
UPDATE TABLE SET type = 1 WHERE type is NULL
使用这样的东西
Update T SET type = 1 FROM [Table] as T WHERE type IS NULL
听起来您可能在失败的 [Table] 上有一个触发器。这通常会发生,因为触发器并非旨在一次处理多个更新。如果表上有触发器,请确保它正确使用 INSERTED 和 DELETED 表。