Tuesday, February 24, 2009

Restoring SQL database using TSQL Script

Scenario:
Solution:
Code:

RESTORE DATABASE CustomDB FROM 
DISK = 'C:\CustomDB_full_backup.bak'
WITH
MOVE 'CustomDB' to 'C:\Program Files\Microsoft SQL Server\MSSQL.2\MSSQL\Data\CustomDB.mdf',
MOVE 'CustomDB_log' to 'C:\Program Files\Microsoft SQL Server\MSSQL.2\MSSQL\Log\CustomDB_Log.ldf'

Article:

0 comments: