@@OpenCount And DBCC OpenTran
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.
精彩评论