I know that we can use
select @@trancount and
select * from sys.sysprocesses where open_tran = 1 to find if a session has an open transaction in a given database. The problem with these statements is I have to run them in the same window where the transaction was begun.
We have 10 different databases in our dev server. I want to know if there is a way to find out if a transaction is open in any of those databases across any session. I have a problem where I started a transaction to test something and closed the session without committing or rolling it back. I want to find out if the transaction is still open and if so how do I close it?