Wednesday, February 22, 2012

Restoring Database

USE [master]

ALTER DATABASE [Employee]

SET SINGLE_USER WITH ROLLBACK IMMEDIATE;


RESTORE DATABASE [Employee] FROM

DISK = N'F:\Employee_Aug_08_2011.bak'

WITH FILE = 1, MOVE N 'Employee_Prod'

TO N'F:\Microsoft SQL Server Database Files\MSSQL10_50.TSTIM\MSSQL\DATA\Employee.mdf',

MOVE N'eSubmission_Prod_log' TO N'F:\Microsoft SQL Server Database Files\MSSQL10_50.TSTIM\MSSQL\DATA\Employee.ldf',

NOUNLOAD, REPLACE, STATS = 10

GO

USE
[Employee]

ALTER DATABASE [Employee]

SET MULTI_USER;

No comments: