久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

在存儲過程結束時顯式刪除本地臨時表有什么好

Any benefit to explicitly dropping local temporary tables at the end of a stored procedure?(在存儲過程結束時顯式刪除本地臨時表有什么好處?)
本文介紹了在存儲過程結束時顯式刪除本地臨時表有什么好處?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

考慮以下偽 T-SQL 代碼(由存儲過程執行):

Consider the following psuedo T-SQL code (performed by a stored procedure):

CREATE TABLE #localTable ...

<do something with the temporary table here>

DROP TABLE #localTable;

DROP TABLE 語句是存儲過程執行的最后一條語句——該語句有什么好處嗎?

The DROP TABLE statement is the last statement executed by the stored proceudre – is there any benefit to that statement?

請注意,我不是在詢問在存儲過程的中間(即在不再需要表之后,但在存儲過程結束之前)刪除臨時表(本地或非本地)過程代碼)——由于減少了繼續執行存儲過程所需的內存,這似乎具有重要的好處.我想知道在存儲過程完成執行時顯式刪除表與讓"SQL Server 這樣做是否有任何好處(或任何影響,實際上是積極的消極的).

Note that I'm not asking about dropping temporary tables (local or not) in the middle of the stored procedure (i.e. after the tables are no longer needed, but before the end of the stored procedure code) – that could seemingly have important benefits due to decreasing the memory required to continue executing the stored procedure. I want to know whether there's any benefit (or any effect, really, positive or negative) to explicitly dropping the table versus 'letting' SQL Server do so when the stored procedure finishes executing.

推薦答案

這樣做不會有什么壞處,但是當連接斷開時表會被刪除.我個人認為進入是一個好習慣.它還可以讓開發人員(可能需要為此工作),您不會忘記這樣做.

Won't hurt to do so, but the table gets dropped when the connection is dropped. I personally think it's a good habit to get into. It also lets developers, who might have to work on this, that you didn't simply forget to do it.

這篇關于在存儲過程結束時顯式刪除本地臨時表有什么好處?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Converting Every Child Tags in to a Single Column with multiple Delimiters -SQL Server (3)(將每個子標記轉換為具有多個分隔符的單列-SQL Server (3))
How can I create a view from more than one table?(如何從多個表創建視圖?)
Create calculated value based on calculated value inside previous row(根據前一行內的計算值創建計算值)
How do I stack the first two columns of a table into a single column, but also pair third column with the first column only?(如何將表格的前兩列堆疊成一列,但也僅將第三列與第一列配對?) - IT屋-程序員軟件開發技
Recursive t-sql query(遞歸 t-sql 查詢)
Convert Month Name to Date / Month Number (Combinations of Questions amp; Answers)(將月份名稱轉換為日期/月份編號(問題和答案的組合))
主站蜘蛛池模板: 日韩伦理一区二区 | 亚洲欧美在线视频 | 免费一级片 | 国产不卡在线播放 | 中文字幕在线一区二区三区 | 久久亚洲国产精品日日av夜夜 | 国产乱人伦 | 欧美 日韩精品 | 人人爽日日躁夜夜躁尤物 | 成人免费看电影 | 91在线视频播放 | av在线免费看网址 | 午夜国产 | 久久男人天堂 | 久久青青 | 欧美国产中文 | www.久久久久久久久 | 国产精品2 | k8久久久一区二区三区 | 成人av免费网站 | 久久久久国产一区二区 | 国产精品美女久久久久久久网站 | 毛片免费看 | 男女视频在线观看免费 | 中文av字幕| 久久精品黄色 | 亚洲一区视频 | 国产不卡一区 | 超碰综合 | 亚洲国产欧美在线 | 久久久精品 | 午夜影院视频 | 一区二区三区日本 | 一级毛片免费看 | 女朋友的闺蜜3韩国三级 | 日韩视频在线一区 | 欧美日韩一区二区在线播放 | 日韩精品影院 | 成人免费观看视频 | 日韩欧美不卡 | 午夜av成人|