Restore Database SQL script
USE [master]
RESTORE FILELISTONLY
FROM DISK = N'D:\Biraj\TestDB.bak'
GO
ALTER DATABASE TestDB SET SINGLE_USER WITH ROLLBACK IMMEDIATE
GO
RESTORE DATABASE [TestDB20130513] FROM DISK = N'D:\Biraj\TestDB.bak' WITH FILE = 1,
MOVE N'TestDB' TO N'C:\Program Files\Microsoft SQL Server\MSSQL11.SQL2012\MSSQL\DATA\TestDB20130513.mdf',
MOVE N'TestDB_log' TO N'C:\Program Files\Microsoft SQL Server\MSSQL11.SQL2012\MSSQL\DATA\TestDB_log20130513.ldf', NOUNLOAD, STATS = 5
GO
ALTER DATABASE TestDB SET MULTI_USER WITH ROLLBACK IMMEDIATE
GO
No comments:
Post a Comment