O'Reilly logo

Microsoft SQL Server 2014 Unleashed by Paul Bertucci, Alex T. Silverstein, Chris Gallelli, Ray Rankins

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Restores with T-SQL

The command to restore a database in SQL Server is aptly named RESTORE. The RESTORE command is similar to the BACKUP command in that it can be used to restore a database, part of a database, or a transaction log. You restore an entire database or part of a database by using the RESTORE DATABASE syntax. You do transaction log restores by using the RESTORE TRANSACTION syntax.

Database Restores with T-SQL

Listing 11.6 shows the full syntax for RESTORE DATABASE.

LISTING 11.6 RESTORE DATABASE Syntax

--To Restore an Entire Database from a Full database backup(a Complete Restore):RESTORE DATABASE { database_name | @database_name_var }[ FROM <backup_device> [ ,...n ] ][ WITH   [ { CHECKSUM | NO_CHECKSUM ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required