Automating Transaction Log Management

You can use sp_thresholdaction to identify the oldest active transaction and use sp_xact_loginfo to monitor the longest running transaction per database or abort the oldest active transaction based on conditional criteria.