Learn more about SQL Server tools

mssqltips logo
 

Tutorials          DBA          Dev          BI          Career          Categories          Webcasts          Whitepapers          Today's Tip          Join

Tutorials      DBA      Dev      BI      Categories      Webcasts

DBA    Dev    BI    Categories

 

Get SQL Server Restore Percentage Complete



By:

Overview

The RESTORE WITH STATS option allows you to see how far along the restore process is, this can be used for RESTORE DATABASE, RESTORE LOG, RESTORE VERIFYONLY.

Explanation

The RESTORE WITH STATS option will give you an idea of where the restore process currently is an the overall process. This information is presented in percentage of completion. The default is to display after every 10% or a percentage value can be specified. This information is displayed on the Messages tab in your query window.


T-SQL

Restore a full database with default stats setting
The following will show the percentage complete after each 10% segment.

RESTORE DATABASE 'AdventureWorks' FROM DISK = 'C:\AdventureWorks.BAK'
GO

Restore a full database with stats showing for each 1 percent complete
This will show progress after each 1% of completion.

RESTORE DATABASE 'AdventureWorks' FROM DISK = 'C:\AdventureWorks.BAK' WITH STATS = 1
GO

SQL Server Management Studio

When restoring a database using SSMS, this information is displayed as shown in the highlighted section below. The default is 10% which can not be changed for the GUI.


Last Update: 3/17/2009




More SQL Server Solutions











Post a comment or let the author know this tip helped.

All comments are reviewed, so stay on subject or we may delete your comment. Note: your email address is not published. Required fields are marked with an asterisk (*).

*Name    *Email    Email me updates 


Signup for our newsletter
 I agree by submitting my data to receive communications, account updates and/or special offers about SQL Server from MSSQLTips and/or its Sponsors. I have read the privacy statement and understand I may unsubscribe at any time.



    



Learn more about SQL Server tools