Advertisement
Guest User

Untitled

a guest
Jul 19th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. SELECT *,
  2. case transaction_type
  3. when 1 then 'Read/Write'
  4. when 2 then 'Read-Only'
  5. when 3 then 'System'
  6. when 4 then 'Distributed'
  7. else 'Unknown - ' + convert(varchar(20), transaction_type)
  8. end as tranType,
  9. case transaction_state
  10. when 0 then 'Uninitialized'
  11. when 1 then 'Not Yet Started'
  12. when 2 then 'Active'
  13. when 3 then 'Ended (Read-Only)'
  14. when 4 then 'Committing'
  15. when 5 then 'Prepared'
  16. when 6 then 'Committed'
  17. when 7 then 'Rolling Back'
  18. when 8 then 'Rolled Back'
  19. else 'Unknown - ' + convert(varchar(20), transaction_state)
  20. end as tranState,
  21. case dtc_state
  22. when 0 then NULL
  23. when 1 then 'Active'
  24. when 2 then 'Prepared'
  25. when 3 then 'Committed'
  26. when 4 then 'Aborted'
  27. when 5 then 'Recovered'
  28. else 'Unknown - ' + convert(varchar(20), dtc_state)
  29. end as dtcState
  30. FROM sys.dm_tran_active_transactions
  31. ORDER BY transaction_begin_time
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement