Skip to content

How to View Currently Executing Queries in SQL Server

November 12, 2009

Here’s a quick TSQL query to find the “currently executing queries” and the database name:

SELECT db.name,
er.session_id,
er.transaction_id,
er.start_time,
er.[status],
er.command,
er.wait_time
-- etc.
FROM sys.dm_exec_requests AS er
JOIN sys.sysdatabases AS db
ON er.database_id = db.dbid
WHERE er.status = 'running'

Here’s the query in action:

RunningQueries


Leave a comment

  • Archives


  • RSS SQLServerPedia

  • RSS SQL Crunch – Hot SQL Links

  • My Bookmarks

  • Business Career DBA Tool Events free ebook Humor IT News Members Only Microsoft MySQL Operating System Oracle Personal Reporting Services SQL Server SQLServerPedia Syndication SSC SSIS TSQL Tutorial Uncategorized Video

  • Software Blogs - BlogCatalog Blog Directory