Quickie: How to View Currently Executing Queries in SQL Server

2009 November 12

[This is actually *stolen* from Brad McGehee Twitter Stream. I am posting it here for reference for those who might be needing it]

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


One Response leave one →

Trackbacks & Pingbacks

  1. Bir programcının dünyası » SQL Server’da o anda çalışan sorguları listelemek

Leave a Reply

Note: You can use basic XHTML in your comments. Your email address will never be published.

Subscribe to this comment feed via RSS

  • Archives



  • RSS SQLServerPedia

  • RSS SQL Crunch – Hot SQL Links

  • My Bookmarks

  • Category Cloud

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