![](/img/trans.png)
[英]Why is it no slower to SELECT into a temp table then MERGE than it is just to MERGE from the source query?
[英]Why is an SQL update on a table variable slower than with a temp table
我有类似的东西:
DECLARE @tbl TABLE
(
name varchar(255),
type int
)
UPDATE c
SET c.name = t.name
FROM dbo.cars c
JOIN @tbl t ON t.type = c.type
我有一个类似的存储过程,但使用表变量需要20多分钟。 如果我将它从表变量更改为临时表,它将在不到2分钟的时间内运行。 为什么会这样?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.