What causes open transactions sys.dm_exec_requests?

  • What actually opens a transaction? For example, if I look at the currently running queries, several may say running but it one my have open_transaction_count = 0 while the other may be = 1. How can a request be be running but not be considered an open transaction? Is it just explicit transcations? I thought any running statment in SQL server was considered to be an transaction, just implicitly. Can someone explain?

  • All statements are atomic, either they complete successfully or they fail, so yes they maintain their own transactions internally to ensure that all work done by the statement either completes or none of it completes. That said, those do not register as open transactions because technically the transaction is managed internally by SQL Server. sys.dm_exec_requests only shows open explicit transactions of running sessions.

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • Got it, thanks!

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply