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.
我必须删除一些数据并将一些数据插入同一个表中。
如果我们在循环中使用 Upsert 会有任何性能改进吗?
不,只需使用一个简单的
DELETE ... INSERT ...
...也可能在交易中
您不能在 SQL Server 2005 中“UPSERT”。为 SQL Server 2008 添加了 MERGE。
循环几乎永远不是数据库引擎中任何查询的答案