开发者

@@OpenCount And DBCC OpenTran

开发者 https://www.devze.com 2023-02-01 10:06 出处:网络
Can you Explain what is difference between this two statement: 1)select @@trancount 2)DBCC opentran when I Use TransactionScope in C# Statement No.1 return 0 bu开发者_开发问答t No.2 return Result.

Can you Explain what is difference between this two statement:

1)select @@trancount

2)DBCC opentran

when I Use TransactionScope in C# Statement No.1 return 0 bu开发者_开发问答t No.2 return Result.

when I Use begin Tran in sql server No.1 return 1 but No.2 return nothing.

what is difference between them?


FRom @@TRANCOUNT (Transact-SQL)

Returns the number of BEGIN TRANSACTION statements that have occurred on the current connection.

and from DBCC OPENTRAN (Transact-SQL)

Displays information about the oldest active transaction and the oldest distributed and nondistributed replicated transactions, if any, within the specified database.

0

精彩评论

暂无评论...
验证码 换一张
取 消