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

@@TRANCOUNT 和當前連接

@@TRANCOUNT and a current connection(@@TRANCOUNT 和當前連接)
本文介紹了@@TRANCOUNT 和當前連接的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

假設我通過 SQL Server Management Studio ( SSMS ) 連接到 SQL Server 2008 并通過單擊新建查詢"選項卡打開新窗口 W1 并在 W1 中寫入以下內容:

Assume I connect to SQL server 2008 via SQL Server Management Studio ( SSMS ) and open new window W1 by clicking on New Query tab and write the following inside W1:

BEGIN TRANSACTION;

如果我執行這個語句5次,然后寫(在W1里面)

If I execute this statement 5 times, and then write (inside W1)

SELECT @@TRANCOUNT;

,那么返回的值將是 5.但是如果我打開另一個窗口 W2(在同一個 SSMS 實例內,因此在同一個連接上)并在 W2 內寫入

, then the value returned will be 5. But if I open another window W2 ( inside the same SSMS instance and thus on the same connection ) and write inside W2

SELECT @@TRANCOUNT; 

那么返回的值為 0.

@@TRANCOUNT 變量返回當前連接的活動事務數.

@@TRANCOUNT variable returns the number of active transactions for the current connection.

W1 和 W2 窗口都在同一個連接上打開,所以不應該(根據上面的引用)在 W1W2 變量 @@TRANCOUNT 中保持相同的價值?

Both W1 and W2 windows were opened on the same connection, so shouldn’t ( according to the above quote ) in both W1 and W2 variable @@TRANCOUNT hold the same value?

謝謝

推薦答案

SSMS 中的每個查詢窗口都是一個單獨連接,在單獨的 spid 上運行.查詢窗口選項卡中括號中的數字是您當前窗口的連接號.

Every query window in SSMS is a separate connection, running on a separate spid. The number in parenthesis in the query window tab is your connection number for the current window.

打開幾個窗口,并根據需要在每個窗口中打開事務,您應該能夠看到每個窗口都顯示在調用 sp_who2 的結果中.使用窗口選項卡中的 spid 編號,您將能夠在該過程的結果中找到每一行.您還可以在每個查詢窗口底部的狀態欄中以及每個打開的查詢窗口的屬性窗口中找到有關您的連接的詳細信息.

With a couple windows open, and open transactions in each if you like, you should be able to see each one of them show up in the results of a call to sp_who2. Using the spid number from the window tab you'll be able to find each row in the results of that proc. You can also find detailed information about your connection in the status bar at the bottom of each query window, and also in the properties window for each open query window.

這篇關于@@TRANCOUNT 和當前連接的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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)(將月份名稱轉換為日期/月份編號(問題和答案的組合))
主站蜘蛛池模板: 国产免费a视频 | av第一页| 欧美精品导航 | 精品国产不卡一区二区三区 | 欧美专区在线 | 亚洲精品一区二区在线观看 | 日韩精品一区二区三区在线观看 | 亚洲激情在线观看 | 久久剧场 | 精品久久久久久亚洲精品 | 九九看片 | 亚洲精品一区二区三区四区高清 | 日韩av在线中文字幕 | 成人毛片视频在线播放 | 国产日韩欧美 | 国产精品国产成人国产三级 | 久久一区二区三区免费 | 久久美女网 | 精品1区 | 日日操日日干 | 粉色午夜视频 | 在线一区视频 | 午夜精品久久久久99蜜 | 色免费在线视频 | 国产91精品久久久久久久网曝门 | 91精品国产91久久久久久密臀 | 国产成年人小视频 | 国产中文字幕av | 亚洲区一区二 | 农村妇女毛片精品久久久 | 亚洲国产91 | 在线观看日韩av | 91久久精品国产91久久性色tv | 国产一区二区在线看 | 在线免费观看毛片 | tube国产 | 国产精品免费在线 | 欧美精品一区在线 | 久久久久久国产精品 | 韩日视频在线观看 | 最近日韩中文字幕 |