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

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

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

問(wèn)題描述

考慮以下偽 T-SQL 代碼(由存儲(chǔ)過(guò)程執(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 語(yǔ)句是存儲(chǔ)過(guò)程執(zhí)行的最后一條語(yǔ)句——該語(yǔ)句有什么好處嗎?

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

請(qǐng)注意,我不是在詢(xún)問(wèn)在存儲(chǔ)過(guò)程的中間(即在不再需要表之后,但在存儲(chǔ)過(guò)程結(jié)束之前)刪除臨時(shí)表(本地或非本地)過(guò)程代碼)——由于減少了繼續(xù)執(zhí)行存儲(chǔ)過(guò)程所需的內(nèi)存,這似乎具有重要的好處.我想知道在存儲(chǔ)過(guò)程完成執(zhí)行時(shí)顯式刪除表與讓"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.

推薦答案

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

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)于在存儲(chǔ)過(guò)程結(jié)束時(shí)顯式刪除本地臨時(shí)表有什么好處?的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

相關(guān)文檔推薦

Converting Every Child Tags in to a Single Column with multiple Delimiters -SQL Server (3)(將每個(gè)子標(biāo)記轉(zhuǎn)換為具有多個(gè)分隔符的單列-SQL Server (3))
How can I create a view from more than one table?(如何從多個(gè)表創(chuàng)建視圖?)
Create calculated value based on calculated value inside previous row(根據(jù)前一行內(nèi)的計(jì)算值創(chuàng)建計(jì)算值)
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?(如何將表格的前兩列堆疊成一列,但也僅將第三列與第一列配對(duì)?) - IT屋-程序員軟件開(kāi)發(fā)技
Recursive t-sql query(遞歸 t-sql 查詢(xún))
Convert Month Name to Date / Month Number (Combinations of Questions amp; Answers)(將月份名稱(chēng)轉(zhuǎn)換為日期/月份編號(hào)(問(wèn)題和答案的組合))
主站蜘蛛池模板: 国产小视频在线 | 国产91精品久久久久久久网曝门 | 亚洲www.| 免费观看一级特黄欧美大片 | 在线观看欧美一区 | 香蕉久久网 | 羞羞视频在线网站观看 | 久久久久久国产精品三区 | 亚洲高清在线观看 | 97精品超碰一区二区三区 | 亚洲在线一区 | 久久久久久久综合 | 国产成人麻豆免费观看 | 99re视频在线 | 国产福利在线 | 九九综合 | 欧美激情一区 | 免费在线视频精品 | 中文一区二区视频 | 中文av字幕 | 国产午夜精品久久 | 久久国产精品视频 | 日韩久久精品电影 | 在线看免费| 国产精品一区二区免费 | 污片在线观看 | 亚洲精品一 | 亚洲精品一二三 | 精品国产一区二区国模嫣然 | 日一区二区 | 永久精品| 一区二区三区中文字幕 | 精品无码久久久久久久动漫 | 一级毛毛片 | 一区二区三区av夏目彩春 | 精品欧美一区二区在线观看视频 | 久草在线中文888 | 久草中文网 | 日本一区二区三区免费观看 | 免费高清av| 国产乱码久久久 |