need help for copy database

need help for copy database

Post by fran » Wed, 23 Aug 2000 11:29:22



Hi,

Thanks for reading,
I am trying to make a copy of database for safety reason, and used the
instructions from BOL as follows,

BACKUP DATABASE Northwind
    TO DISK = 'c:\Northwind.bak'

RESTORE FILELISTONLY
    FROM DISK = 'c:\Northwind.bak'

RESTORE DATABASE TestDB
    FROM DISK = 'c:\Northwind.bak'
    WITH MOVE 'Northwind' TO 'c:\test\testdb.mdf',
    MOVE 'Northwind_log' TO 'c:\test\testdb.ldf'

But I cannot get the database TestDB created, and it gives me the following
error message,
The file 'c:\test\testdb.mdf' cannot be used by RESTORE. Consider using the
WITH MOVE option to identify a valid location for the file.

Why and how can I finish this, thanks.
Frank

 
 
 

need help for copy database

Post by fran » Wed, 23 Aug 2000 11:41:30


I am sorry, after I checked and added the folder c:\test, it now works well,
Thanks


Quote:> Hi,

> Thanks for reading,
> I am trying to make a copy of database for safety reason, and used the
> instructions from BOL as follows,

> BACKUP DATABASE Northwind
>     TO DISK = 'c:\Northwind.bak'

> RESTORE FILELISTONLY
>     FROM DISK = 'c:\Northwind.bak'

> RESTORE DATABASE TestDB
>     FROM DISK = 'c:\Northwind.bak'
>     WITH MOVE 'Northwind' TO 'c:\test\testdb.mdf',
>     MOVE 'Northwind_log' TO 'c:\test\testdb.ldf'

> But I cannot get the database TestDB created, and it gives me the
following
> error message,
> The file 'c:\test\testdb.mdf' cannot be used by RESTORE. Consider using
the
> WITH MOVE option to identify a valid location for the file.

> Why and how can I finish this, thanks.
> Frank