Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to create a database, NewClientDB, by restoring another database's, OldClientDB, backup, d:...oldclientdb.bak. I've always done this via SQL 2000 Enterprise Manager, but the GUI keeps hanging. I've already created the empty NewClientDB.

Anyone know how to restore the OldClientDB's backup to NewClientDB via script without affecting OldClientDB?

share|improve this question

migrated from Jun 18 '12 at 19:19

This question came from our site for professional and enthusiast programmers.

FROM  DISK = N'D:\OldClientDB.bak' 
WITH  FILE = 1,  
MOVE N'OldClientDB_Data' TO N'C:\Data\MSSQL.1\MSSQL\Data\AdventureWorksNew_Data.mdf',  
MOVE N'OldClientDB_Log' TO N'C:\Data\MSSQL.1\MSSQL\Data\AdventureWorksNew_Log.ldf',  

Source: BACKUP and RESTORE in SQL Server

share|improve this answer
I'm being pedantic, but I think the NewClientDB_Data etc need to be OldClientDB_Data as those will be the names of the files used from the original db. – Jon Egerton Jun 18 '12 at 21:18
@JonEgerton Not pedantic, Correct! Ill update my answer. – benni_mac_b Jun 18 '12 at 21:22

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.