65.9K
CodeProject is changing. Read more.
Home

Find progress of a database restore using sys.dm_exec_requests

starIconstarIconstarIconstarIconstarIcon

5.00/5 (2 votes)

Jan 15, 2015

CPOL
viewsIcon

7050

Find progress of a database restore using sys.dm_exec_requests

Introduction

Many times as a developer, I struggled to find the progress of my database restore process. Finally one of my colleague helped me to find a way to see the DB restore process progress.

Returns information about each request that is executing within SQL Server.

Executing sys.dm_exec_requests in master DB rreturns information about each request that is executing within SQL Server.

sys.dm_exec_requests

Using the code

A brief description of how to use the article or code. The class names, the methods and properties, any tricks or tips.

Blocks of code should be set as style "Formatted" like this:


USE Master

GO

SELECT percent_complete FROM sys.dm_exec_requests;

SELECT percent_complete FROM sys.dm_exec_requests

OR

SELECT percent_complete FROM sys.dm_exec_requests WHERE session_id = 80 // if you know the session Id

For more details

http://msdn.microsoft.com/en-us/library/ms177648.aspx.