SQL Clone
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Database Restoration SQL Procedure for SQL Server 2014.

By SQL Master,

Procedure Name : usp_db_restore
Objective : This procedure is used for Database(Full, Differential, Transaction Logs) resoration (This script will restore database with recovery mode, you can alter the procedure acc. to your need)
Author : Rahul Biswas
Create Date : Rahul Biswas
Modified By : Rahul Biswas
Modified Date : 31th AUG 2017
E.g. as
exec usp_db_restore 'rahulnew', 'c:\test\Rahul\', 'B','c:\test\Rahul\','c:\test\Rahul\'
exec usp_db_restore 'DatabaseName', 'BackupPath', 'BackupType','DatafilePath(Includes.mdf and .ndf)','LogFilePath'
The backup types are: B = Full Backup, D = Differential Backup, L = Log Backup
Note : backup path includes backup name only not with extension for E.g. backup file as 'c:\test\Rahul\test.bak' than you've specify 'c:\test\Rahul\test' in the parameter.

Total article views: 356 | Views in the last 30 days: 5
Related Articles




Backup restore

Backup And Restore


Backup and restore

Backup and restore


Backup or Restore progess

This procedure provides you the progess of the database backup or restore. We can execute the proced...


More Intelligent Backup and Restore

Backups and restores are two fundamental tasks that a DBA must perform correctly. But remembering th...