SQL – back-up / restore status
By: Date: August 4, 2021 Categories: SQL Tags: , , , ,

You can use this script to view the back-up or restore status.

SELECT session_id as SPID, Command, x.text AS Query, Start_time, Percent_Complete, dateadd(second,Estimated_Completion_Time/1000, getdate()) as Estimated_Completion_Time
FROM sys.dm_exec_requests r CROSS APPLY sys.dm_exec_sql_text(r.sql_handle) x
WHERE r.command in ('BACKUP DATABASE','RESTORE DATABASE')

One thought on “SQL – back-up / restore status

Leave a Reply

Your email address will not be published. Required fields are marked *