Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Open transactions on a database

By kyle.eldridge,

Updated 06/03/2013:

-- Added database support to query a specific database.

-- due to this, i have removed mdsd.NAME AS 'Database with open Transaction'

-- Fixed some code which was causing the open transactions to display incorrectly.

-- Fixed the transaction isolation levels to show unspecified, read uncommitted, read committed, repeatable read, serializable and also snapshot.

Initial Release:

This script was produced due to slowness on one of our servers.

The slowness was caused by a transaction which was undetected due to a number of query windows being open.

this script will show you the following:

  • Computer/Host Name
  • Windows Username
  • Database which the transaction is being run from
  • Session ID
  • Number of open transactions
  • Date the query window was first opened.
  • If the query window is a user process or not
  • The transaction isolation level
  • Lock timeout of the query.

Total article views: 3738 | Views in the last 30 days: 4
 
Related Articles
ARTICLE

Process to truncate transaction log of replicated database

This article demonstrated the steps which you must follow to gracefully truncate the publisher datab...

FORUM

Unable to connect to Database Engine on New Query Window

Query Window not connecting to the DB Engine

FORUM

Check Statement aborted. Database contains deferred transactions.

Please help me, Check statement aborted. Database contains deferred transactions.

FORUM

Long running transactions

Need to create a monitor which can Query a Database

FORUM

Database mirroring with transactional replication

Database mirroring with transactional replication

Tags
transactions    
t-sql    
 
Contribute