Last active
December 16, 2015 00:28
-
-
Save thzinc/5347317 to your computer and use it in GitHub Desktop.
T-SQL query to get information from SQL Server 2008 (and R2) about all running requests, along with percentage of completion. Originally got it from a blog somewhere... Can't remember whose it was.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
r.session_id, | |
t.text, | |
r.status, | |
r.command, | |
database_name = DB_NAME(r.database_id), | |
r.cpu_time, | |
r.total_elapsed_time, | |
r.percent_complete | |
FROM sys.dm_exec_requests r | |
CROSS APPLY sys.dm_exec_sql_text(r.sql_handle) t |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment