Home > SQL > Restore Database

Restore Database

Restore the logical file from the backup file

RESTORE FILELISTONLY
FROM DISK = ‘Backup file full path\filename.extension’

Restore the database in same path as in the backup database path and file name

Restore database DBName

to disk=’Backup file full path\filename.extension’

Restore the database with different logical name and path

RESTORE DATABASE DBName
FROM DISK = ‘Backup file full path\filename.extension’
WITH MOVE ‘YourMDFLogicalName’ TO ‘New Restore file full path\filename.extension’,
MOVE ‘YourLDFLogicalName’ TO ‘New Restore file full path\filename.extension’

Reference:

Pinal Dave (http://blog.sqlauthority.com/2007/02/25/sql-server-restore-database-backup-using-sql-script-t-sql/)

Pinal Dave (http://blog.SQLAuthority.com)

Advertisements
Categories: SQL
  1. No comments yet.
  1. November 27, 2012 at 12:44 pm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

%d bloggers like this: