T-SQL to find Backup or Restore Progress | SansSQL

Friday, May 20, 2022

T-SQL to find Backup or Restore Progress

Here is a script that comes handy while performing a huge database Backup or Restore. This script provides the details on the progress of the Backup or Restore operation including the estimated finish time.
SELECT 
   session_id AS SPID, command AS [Command], a.text AS Query, start_time AS [Start Time], 
   percent_complete AS [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) a 
WHERE r.command like 'BACKUP%' OR r.command like 'RESTORE%') 

4 comments:

MEGAGAME said...

บริการเกมสล็อตออนไลน์ปี 2022 เกมให้เลือกเล่นมากกว่า 1,000 เกมซุปเปอร์สล็อตเล่นผ่านเว็บ f

MEGAGAME said...

บริการเกมสล็อตออนไลน์ปี 2022 เกมให้เลือกเล่นมากกว่า 1,000 เกมสล็อตออนไลน์ d

james R said...

Thank you for every other informative blog. The place else could I am getting that type of information written in such an ideal means? I’ve a mission puffer jacket that I am just now operating on, and I have been on the glance out for such info.

tanapol said...

We have a sports website Let's introduce you guys. Follow up here Today we have a good sports website for you to follow. Click here.ผลบอลสด7เอ็ม

Post a Comment

Ads