RESTORE
writes backup content back
What changes
- Input
- backup device, file or URL
- Output or change
- database, files or log
Syntax at a glance
RESTORE DATABASE { database_name | @database_name_var } [ FROM <backup_device> [ ,...n ] ] [ WITH { [ RECOVERY | NORECOVERY | STANDBY = {standby_file_name | @standby_file_name_var } ] | , <general_WITH_options> [ ,...n ] | , <replication_WITH_option> | , <change_data_capture_WITH_option> | , <FILESTREAM_WITH_option> | , <service_broker_WITH options> | , <point_in_time_WITH_options-RESTORE_DATABASE> } [ ,...n ] ] [;]
Work example
An incident requires restoring a database to a named point in time.
Build the full, differential, and log sequence from backup metadata and confirm the target and recovery point.
Check your work A lab restore reaches the requested time and passes consistency and application checks.
Open Microsoft Learn for full syntax, permissions, and details for your version.