Restoring Deferential backups in SQL Server (T-SQL)

In my previous post I demonstrated, how to restore deferential backups with SQL Management Studio. In this post, I'll show the same thing with T-SQL.

  1. Select the Master database.
    USE Master
    GO
  2. Restore the latest full back up with REPLACE and RECOVERY option
    RESTORE DATABASE RESTORE_COSTSHEET
    FROM DISK = 'e:\backup_201007282300.bak'
    WITH REPLACE,NORECOVERY;
  3. Restore all deferential backups except last one
    RESTORE DATABASE RESTORE_COSTSHEET
    FROM DISK = 'e:\201006110800.incr'
    WITH NORECOVERY;
  4. Restoration of Last back up file should be like this.
    RESTORE DATABASE RESTORE_COSTSHEET
    FROM DISK = 'e:\201006111200.incr'
    WITH RECOVERY;

Comments

Popular posts from this blog

IIS 7.5: 401 Unauthorized Access Error (Keep prompting Username/password)

Calculating Elapsed Time Accurately (C#)

Connecting DB2/iSeries From .net Application