?
Solved

restore a database

Posted on 2006-10-25
3
Medium Priority
?
321 Views
Last Modified: 2012-05-05
I am trying to restore a database using its full backup BAK file taken earlier from a server. We were on the process of transferring all the databases from a 2000 system on an old server to a 2005 system on a new server during the time this BAK file is taken. According to the error message below I think this BAK file is for 2005 version on the new server but I am not positive.

Now when I try to store it to a database on my own PC (2005), I got:
System.Data.SqlClient.SqlError: Directory lookup for the file "D:\SQL\mydatabase.mdf" failed with the operating system error 21(The device is not ready.).(Microsoft.SqlServer.Smo)                 --note: D:\SQL\ is the pathname for the database files on the server.

When I try to store it to the server (2005) with a different database name, I got:
System.Data.SqlClient.SqlError: The file 'D:\SQL\mydatabase.mdf' cannot be overwritten. It is being used by database 'mydatabase'.(Microsoft.SqlServer.Smo)

My questions are:
1. Does this mean I can't restore the database to a different machine? But I was able to do the same with SQL 2000 to any machines without a problem.
2. The error message on the server seems to indicate it's trying to overwrite the existing database although I have specified a different database name. What can I do to bypass the problem?

Thanks.
0
Comment
Question by:sdc248
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 20

Accepted Solution

by:
Sirees earned 500 total points
ID: 17806673
Are you restoring the backup file or attaching the .mdf file?


<<--note: D:\SQL\ is the pathname for the database files on the server.>>

If you are restoring on your PC, that path should point to your PC and not the server.




0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question