30.06.2013 Views

SQL Server Backup and Restore - Simple Talk

SQL Server Backup and Restore - Simple Talk

SQL Server Backup and Restore - Simple Talk

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 9: File <strong>and</strong> Filegroup <strong>Backup</strong> <strong>and</strong> <strong>Restore</strong><br />

Message<br />

--------------------------------------------------<br />

This is the initial data load for the table<br />

This is the second data load for the table<br />

This is the point-in-time data load for the table<br />

This is the third data load for the table<br />

(4 row(s) affected)<br />

Message<br />

--------------------------------------------------<br />

This is the initial data load for the table<br />

This is the second data load for the table<br />

This is the point-in-time data load for the table<br />

This is the third data load for the table<br />

(4 row(s) affected)<br />

Listing 9-23: Verifying the restored data.<br />

Restoring to a point in time (native T-<strong>SQL</strong>)<br />

Listing 9-24 shows the script to restore our DatabaseForFile<strong>Backup</strong>s to a point in<br />

time either just before, or just after, we inserted the two rows in Listing 9-11.<br />

USE master<br />

GO<br />

RESTORE DATABASE [DatabaseForFile<strong>Backup</strong>s] FILE = N'DatabaseForFile<strong>Backup</strong>s'<br />

FROM DISK = N'C:\<strong>SQL</strong><strong>Backup</strong>s\Chapter9\DatabaseForFile<strong>Backup</strong>s_FG1_Full.bak'<br />

WITH REPLACE<br />

GO<br />

RESTORE DATABASE [DatabaseForFile<strong>Backup</strong>s] FILE = N'DatabaseForFile<strong>Backup</strong>s_Data2'<br />

FROM DISK = N'C:\<strong>SQL</strong><strong>Backup</strong>s\Chapter9\DatabaseForFile<strong>Backup</strong>s_FG2_Full.bak'<br />

WITH NORECOVERY<br />

GO<br />

326

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!