SQL中是否需要删除#temp表? [英] Is it necessary in SQL to DROP the #temp tables ?

查看:370
本文介绍了SQL中是否需要删除#temp表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,



情景如



Hi There,

Scenario like

SELECT x,y
INTO #Temp
FROM
(
    SELECT 1 AS x, 2 AS y
)src

SELECT * FROM #Temp





是否有必要删除此#Temp表?

如果#Temp表没有被删除会发生什么副作用是什么?



任何类型的帮助都是适当的



Is it necessary to delete this #Temp table?
What will happen If #Temp table is not dropped,What are the side effects ?

Any type of help would be appriciated

推荐答案

阅读: http://www.simple-talk.com/sql/t -SQL编程/临时表,在-SQL服务r / [ ^ ]



要简短:通常你不需要,它会根据需要自动删除。但在特殊情况下,为了在长时间运行的复杂会话中进行性能调整,您应该手动完成。
Read this: http://www.simple-talk.com/sql/t-sql-programming/temporary-tables-in-sql-server/[^]

To be short: in general you don''t need to, it is dropped automatically as needed. But in special cases, for performance tuning in case of long-running complex sessions you should do it manually.


这篇关于SQL中是否需要删除#temp表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆