Rotating Header Image

Waiting For A Pot To Boil… Restore Database Progress


Ever kicked off a restore and didn’t set the STATS parameter?

Ever had a separate application handle a restore and not give you any feedback at all on how far along a restore is?

Well if your answer is no than this post / script is NOT for you  :)


If your answer is YES then this script should tickle your fancy:

SELECT	A.start_time as 'RestoreStartTime',
		DATEDIFF(minute, A.start_time, getdate()) as 'CurrentRestoreDurationInMinutes',
		((DATEDIFF(minute, A.start_time, getdate()) * 100) / A.percent_complete) as 'EstimatedTotalDurationInMinutes',
		ROUND(((DATEDIFF(minute, A.start_time, getdate()) * 100) / A.percent_complete) - (DATEDIFF(minute, A.start_time, getdate())), 2) as 'EstimatedTimeRemainingInMinutes',
 FROM	sys.dm_exec_requests A CROSS APPLY 
		sys.dm_exec_sql_text(A.sql_handle) B
 WHERE	A.percent_complete != 0


Enjoy!! (Follow me on Twitter: @ColinStasiuk)

Post to Twitter Post to Delicious Post to Digg Post to StumbleUpon


  1. Chris Wood says:

    Certainly helps us with many scripted big database restores to get an estimate of how much longer they will take.



  2. Chris Wood says:

    Seems to work well on a backup process too!


  3. I added the requirement that its design and/or material would prevent scratching. After doing some research and reading reviews on Amazon, I settled on i-Blason’s Halo Scratch Resistant Hybrid Clear Case.

  4. Early cases are often accurate and serve as a solid indicator of what an upcoming iOS device might look like, but on occasion, case makers get design details wrong..

Leave a Reply

Twitter links powered by Tweet This v1.6.1, a WordPress plugin for Twitter.