Created
June 20, 2021 23:16
-
-
Save ghotz/1c3a68872dd8b15ebf8ce746b3881944 to your computer and use it in GitHub Desktop.
Get Backup/Restore operations with completion times
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 | |
session_id, command, start_time, percent_complete, | |
estimated_completion_time AS estimated_completion_time_ms, | |
estimated_completion_time / (1000 * 60) AS estimated_completion_time_min | |
FROM | |
sys.dm_exec_requests | |
WHERE | |
command IN ('BACKUP DATABASE', 'BACKUP LOG', 'RESTORE DATABASE', 'RESTORE LOG', 'RESTORE HEADERONLY', 'RESTORE FILELISTONLY') | |
ORDER BY estimated_completion_time; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment