Thanks for respons Gail but this query won't retun the open transation statement. e.g.
Suppose I runthis query:
begin tran
update employee set is_active=1
Nowit is an open transaction since it i not committed or rollback as of now.
Now if Irun the query shared by you, nowhere it will show me in 'text' column the statemet 'update employee set is_active=1'.
So i won't know which statemet is causing the open transaction.
Online Trainer For SQL DBA and Developer @RedBushTechnologies with 18 yrs exp.