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

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

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

問題描述

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

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 語句是存儲過程執(zhí)行的最后一條語句——該語句有什么好處嗎?

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

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

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.

推薦答案

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

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.

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

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

相關(guān)文檔推薦

Converting Every Child Tags in to a Single Column with multiple Delimiters -SQL Server (3)(將每個子標(biāo)記轉(zhuǎn)換為具有多個分隔符的單列-SQL Server (3))
How can I create a view from more than one table?(如何從多個表創(chuàng)建視圖?)
Create calculated value based on calculated value inside previous row(根據(jù)前一行內(nèi)的計算值創(chuàng)建計算值)
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屋-程序員軟件開發(fā)技
Recursive t-sql query(遞歸 t-sql 查詢)
Convert Month Name to Date / Month Number (Combinations of Questions amp; Answers)(將月份名稱轉(zhuǎn)換為日期/月份編號(問題和答案的組合))
主站蜘蛛池模板: 亚洲成人av| 成人av激情 | 蜜桃av一区二区三区 | 日韩一区二区久久 | 国产成人精品久久二区二区91 | 99热国产在线播放 | 中文字幕在线一区二区三区 | 欧美成人a | 一区二视频 | 日韩在线免费观看视频 | 亚洲国产精品一区二区第一页 | 超碰97人人人人人蜜桃 | 日韩一区二区av | 在线只有精品 | 久久久91精品国产一区二区三区 | 国内在线视频 | 四虎在线播放 | 一区二区三区在线 | 欧美激情 亚洲 | 91精品一区 | www.色综合 | 麻豆成人在线视频 | 久久欧美高清二区三区 | 国产精品久久久久久久午夜片 | 免费h视频 | 国产精品一区二区视频 | 成在线人视频免费视频 | 欧美日韩一区二区在线观看 | a亚洲精品| 国产一级网站 | 四虎影视在线 | 欧美在线一区二区三区 | 日韩精品一区二区三区 | 精品一区二区视频 | 午夜精品一区二区三区免费视频 | 99pao成人国产永久免费视频 | 久久久国产精品 | 久精品久久 | 国产精品视频久久 | 日韩一及片| 黄色一级电影在线观看 |