久久久久久久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)(將月份名稱轉換為日期/月份編號(問題和答案的組合))
主站蜘蛛池模板: 啪视频在线 | 成人久久18免费网站 | 亚洲精品乱码久久久久久按摩观 | 一区在线视频 | 久久不射电影网 | 国产二区三区 | 天天拍天天草 | 99福利视频| 亚洲色图插插插 | 日韩中文在线观看 | 成人在线免费网站 | 国产精品99久久久久久www | 免费的黄色片子 | 亚洲一级毛片 | 免费a网| 少妇诱惑av| 国产麻豆乱码精品一区二区三区 | 成人不卡在线 | avhd101在线成人播放 | 日韩精品一区二区三区在线观看 | 一级片视频免费 | 欧美综合久久 | 欧美福利在线 | 国产欧美一级 | 色偷偷人人澡人人爽人人模 | 成人三区四区 | 日韩欧美视频网站 | 欧美中文字幕一区二区三区亚洲 | 国产在线精品一区二区 | 精品一区二区三区不卡 | 久久久久亚洲国产| 黄片毛片在线观看 | 中文字幕一级毛片视频 | 一区二区三区日韩 | 国产精品视频一区二区三区不卡 | 一区二区三区免费 | 操久久久| 午夜理伦三级理论三级在线观看 | 精品免费| 免费毛片网 | 美国av片在线观看 |