Tuesday, August 31, 2010

Database Differential Backup Restore

USE master

restore database [DBName]
from disk = 'D:\SQL2005\Backups\Temporary Backups\User DB Backups\FullBackup\DBBackupFolder\DB_backup.bak'
with move 'DBDataFile' to 'D:\SQL2005\Data\DBDataFile.mdf',
move 'DBLogFile' to 'D:\SQL2005\Data\DBLogFile_log.ldf',
norecovery, Replace

--now the diff backup
restore database [PMPoint_0624]
from disk = ' D:\SQL2005\Backups\Temporary Backups\User DB Backups\FullBackup\DBBackupFolder\DB_Restore_backup.bak'
with move ''DBDataFile' to 'D:\SQL2005\Data\DBDataFile.mdf',
move 'DBLogFile' to 'D:\SQL2005\Data\DBLogFile_log.ldf',
recovery

No comments: