Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

restore a database

Posted on 2006-10-25
3
Medium Priority
?
324 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Windocks is an independent port of Docker's open source to Windows.   This article introduces the use of SQL Server in containers, with integrated support of SQL Server database cloning.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.

636 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