RESTORE DATABASE
RESTORE DATABASE is a SQL statement in the Administration category. Restores a database from a backup file. Requires exclusive access to the database. The syntax is RESTORE DATABASE database_name FROM DISK = 'backup_file.bak';. It returns database restored. A typical example: RESTORE DATABASE my_company FROM DISK = 'C:\backups\my_company_full.bak' WITH REPLACE, RECOVERY; -- REPLACE: overwrites existing database -- RECOVERY: database becomes operational after restore -- NORECOVERY: leaves database in restoring state for more restores (differential/log) A close relative is CREATE USER, which creates a new database user account. A close relative is GRANT, which grants specific privileges (SELECT, INSERT, UPDATE, DELETE, ALL) to a user on a database/table. A close relative is REVOKE, which removes previously granted privileges from a user. More about this category: Database administration — CREATE DATABASE, GRANT, REVOKE, SHOW, DESCRIBE. Related Administration entries: CREATE USER, GRANT, REVOKE, SHOW TABLES, DESCRIBE / DESC, SHOW INDEX, SHOW CREATE TABLE, SHOW DATABASES.