久久久久久久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 | 亚洲精品一区二区 | 天天操天天干天天透 | 国产亚洲一区二区精品 | 欧美三区 | 伊人久久免费 | 精品一区二区三区在线观看国产 | 成年人在线播放 | 久久国产精品免费一区二区三区 | 日韩精品人成在线播放 | 99久久久国产精品 | 色综合久久久久 | 午夜精品一区二区三区在线观看 | 久久国产精品久久久久 | 无码一区二区三区视频 | 日日夜夜精品视频 | 在线观看免费观看在线91 | 欧美成人精品激情在线观看 | 天堂网色 | 亚洲一区二区三区桃乃木香奈 | 日韩av大片免费看 | a级片在线 | 伊人网在线播放 | 久久亚洲国产精品日日av夜夜 | 蜜臀久久99精品久久久久久宅男 | 1区2区3区视频 | 日韩一区二区三区在线 | 亚洲精品一区二区三区在线 | 日韩成人在线观看 | 性一区 | 91视频在线看 | 欧美视频福利 | 午夜在线观看免费 | 韩国精品在线观看 | 日本一区二区三区免费观看 | 91视频国产精品 | 国产精品久久性 | 天天操天天操 | 91精品久久 | 日日夜夜免费精品视频 | 日本高清在线一区 |