-- Sample restore script for a database named "Sample" whose back up is on Disk at ’C:\YOUR_PATH\Sample_Monday.bak’
ALTER DATABASE [Sample] SET SINGLE_USER WITH ROLLBACK IMMEDIATE
ALTER DATABASE [Sample] SET SINGLE_USER WITH NO_WAIT
USE master
RESTORE DATABASE [Sample] FROM DISK=’C:\YOUR_PATH\Sample_Monday.bak’ WITH REPLACE;
--- After the restore completes
ALTER DATABASE [Sample] SET MULTI_USER
No comments:
Post a Comment