I understand that an explicit declaration of a distributed transaction (BEGIN DISTRIBUTED TRANSACTION) does not change the @@TRANCOUNT return value at all (and correct me if I'm wrong, because I was unable to test it by myself due to the lack of MS
DTC in my testing platform). But I'm concerned about what could possibly happen with this value when a normal, local transaction, automatically escalates to a distributed one because of a command referring to an external database.
As far as I know, Distributed transactions will not affect @@TRANCOUNT values. MSDN document states:
The BEGIN TRANSACTION statement increments @@TRANCOUNT by 1. ROLLBACK TRANSACTION decrements @@TRANCOUNT to 0, except for ROLLBACK TRANSACTION savepoint_name, which does not affect @@TRANCOUNT. COMMIT TRANSACTION or COMMIT WORK decrement @@TRANCOUNT
For more detail information, you can refer to the following link:
Microsoft is conducting an online survey to understand your opinion of the Technet Web site. If you choose to participate, the online survey will be presented to you when you leave the Technet Web site.