all groups > sql server (alternate) > august 2007 >
You're in the

sql server (alternate)

group:

Restore sql server express bak file as different db?


Restore sql server express bak file as different db? nano
8/24/2007 8:55:37 AM
sql server (alternate):
I have a bak file of a sql server express database from another server,
and I'd like to restore it to my dev box as a different database. Does
Re: Restore sql server express bak file as different db? Erland Sommarskog
8/24/2007 9:49:34 PM
nano (nano@nano.ono) writes:
[quoted text, click to view]

First run

RESTORE FILELIST_ONLY FROM DISK = '<path>'

Make a note of the logical files names. Then run:

RESTORE DATABASE db FROM DISK = '<path>'
WITH MOVE '<logicalfile1>' TO '<pathwhereyouwantit>.mdf',
MOVE '<logicalfile2>' TO '<pathwhereyouwantit>.ldf',
REPLACE

See also the RESTORE command in Books Online. I might have confused
FILELIST_ONLY and HEADERONLY.

--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
AddThis Social Bookmark Button