Hello whenever I select in a new query from the system view sys.dm_tran_session_transactions I get always 0 rows
select * from sys.dm_tran_session_transactions
But people on some other answers use this table.
SQL Server 2005 : map Transaction_ID to @@SPID
Why have I empty this view?
The
sys.dm_tran_session_transactions
DMV will return sessions with open transactions so it seems there were no such sessions when you ran the query. Start a transaction to see the an example of data returned: