Friday, March 23, 2012

How do I import a db into MSDE2000?

How do I import a db into MSDE2000? Can it be done? I backed a db up from
another server and now I want to import on to this new machine. Not sure how
to go about doing that though...
Thanks.
=?Utf-8?B?TWFyaw==?= <Mark@.discussions.microsoft.com> wrote in
news:08A53C86-D697-4147-9277-B859B44F5D2C@.microsoft.com:

> How do I import a db into MSDE2000? Can it be done? I backed a db up
> from another server and now I want to import on to this new machine.
> Not sure how to go about doing that though...
> Thanks.
>
>
Use, e.g. in OSQL,
RESTORE HEADERONLY FROM DISK = 'backup-file-name-and-path'
to get a listing of the contents of the backup file to determine the
logical database name.
Then, if it is for a single mdf/ldf file pair,
RESTORE DATABASE [NewDatabaseName]
FROM DISK='backup-file-name-and-path'
WITH MOVE 'logical-database-name' TO 'NewDatabaseFilename',
MOVE 'logical-database-name_log' TO 'NewDatabaseLogFilename'
The NewDatabaseFilename should have a .mdf extension and the
NewDatabaseLogFilename a .ldf extension.
See RESTORE in BOL for further details.

No comments:

Post a Comment