Specify Whether a Backup or Restore Operation Continues or Stops After Encountering an Error (SQL Server)
This topic describes how to specify whether a backup or restore operation continues or stops after encountering an error in SQL Server 2012 by using SQL Server Management Studio or Transact-SQL.
In This Topic
-
Before you begin:
-
To specify whether a backup or restore operation continues after encountering an error, using:
To specify whether backup continues or stops after an error is encountered
-
Follow the steps to create a database backup.
-
On the Options page, in the Reliability section, click Perform checksum before writing to media and Continue on error.
To specify whether a backup operation continues or stops after encountering an error
-
Connect to the Database Engine.
-
From the Standard bar, click New Query.
-
In the BACKUP statement, specify the CONTINUE_AFTER ERROR option to continue or the STOP_ON_ERROR option to stop. The default behavior is to stop after encountering an error. This example instructs the backup operation to continue despite encountering an error.
BACKUP DATABASE AdventureWorks2012 TO DISK = 'Z:\SQLServerBackups\AdvWorksData.bak' WITH CHECKSUM, CONTINUE_AFTER_ERROR; GO
To specify whether a restore operation continues or stops after encountering an error
-
Connect to the Database Engine.
-
From the Standard bar, click New Query.
-
In the RESTORE statement, specify the CONTINUE_AFTER ERROR option to continue or the STOP_ON_ERROR option to stop. The default behavior is to stop after encountering an error. This example instructs the restore operation to continue despite encountering an error.
RESTORE DATABASE AdventureWorks2012
FROM DISK = 'Z:\SQLServerBackups\AdvWorksData.bak'
WITH CHECKSUM, CONTINUE_AFTER_ERROR;
GO
