mirror of
https://github.com/Microsoft/sql-server-samples.git
synced 2025-12-08 14:58:54 +00:00
12 lines
407 B
Transact-SQL
12 lines
407 B
Transact-SQL
-- Restore the database from backup. Substitute the path 'C:\YourFolder' with the target location of the backup.
|
|
|
|
USE [master]
|
|
ALTER DATABASE [WideWorldImporters] SET SINGLE_USER WITH ROLLBACK IMMEDIATE
|
|
RESTORE DATABASE [WideWorldImporters]
|
|
FROM DISK = N'C:\YourPath\WideWorldImporters_AtShipDate.bak'
|
|
WITH FILE = 1, NOUNLOAD, REPLACE, STATS = 5
|
|
ALTER DATABASE [WideWorldImporters] SET MULTI_USER
|
|
GO
|
|
|
|
|