Wednesday, 31 October 2018

Script to find Estimated Finish Time of The Backup Database

Here is the Script to find Estimated Finish Time of The Backup Database:

Note: This will work when you had initiated process of taking BackUp.

SELECT
session_id
,percent_complete AS CompletedPercent
,DATEADD(MILLISECOND,estimated_completion_time,CURRENT_TIMESTAMP) AS EstimatedFinishTime
,(total_elapsed_time/1000)/60 AS TotalElapsedTimeInMIN
,DB_NAME(Database_id) AS DatabaseName
,command
,sql_handle
FROM sys.dm_exec_requests
WHERE command LIKE '%BACKUP DATABASE%'



Happy Coding !!!

No comments:

Post a Comment

SQL Audits

1. sys.server_audits What it is: Lists all server-level audit objects . An audit is the top-level object that defines: Where to wri...