Wednesday, July 25, 2007

How to restore a sql server database backup?

I had backup a database of my SQL Server 2005, however it can't be restore due to the drive location issue, therefore here is the method to overcome this problem:

Use Master
RESTORE DATABASE DinnerNow FROM
DISK = 'C:\DinnerNow.bak' WITH MOVE
'DinnerNownew' TO
'F:\Program Files\Microsoft SQL
Server\MSSQL.4\MSSQL\Data\DinnerNownew.mdf', MOVE 'DinnerNownew_log' TO
'F:\Program Files\Microsoft SQL
Server\MSSQL.4\MSSQL\Data\DinnerNownew.ldf'
GO

No comments: