1
0
mirror of https://github.com/Microsoft/sql-server-samples.git synced 2025-12-08 14:58:54 +00:00
Files
sql-server-samples/samples/databases/wide-world-importers/wwi-dw-database-scripts/9-wwi-dw-restore.sql
2016-05-25 13:44:41 -07:00

13 lines
409 B
Transact-SQL

-- Restore the database from backup. Substitute the path 'C:\YourFolder' with the target location of the backup.
USE [master]
ALTER DATABASE [WideWorldImportersDW] SET SINGLE_USER WITH ROLLBACK IMMEDIATE
RESTORE DATABASE [WideWorldImportersDW]
FROM DISK = N'C:\YourFolder\WideWorldImportersDW.bak'
WITH FILE = 1, NOUNLOAD, REPLACE, STATS = 5
ALTER DATABASE [WideWorldImportersDW] SET MULTI_USER
GO