Solved

Problem with attaching to a database with SQL Server

Posted on 2006-11-25
3
335 Views
Last Modified: 2008-02-26
Hi,

I tried to attach a MDF database file that was attched before to SQL Server.
but Sql server displays the Error 5123, which says that other process uses the MDF file.
I tried to restart my computer, but the problem is still exist.

Please tell me how to fix it.

Thanks
Michael
0
Comment
Question by:MichaelMarom
3 Comments
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
Comment Utility
>I tried to attach a MDF database file that was attched before to SQL Server.
if that database is still attached to a server, you cannot attach it again.
you have first to detach it from that server, and then you can copy it.
if you have problems identifying which server it is attached to, connect to each instance, and run for each database the query
select * from sysfiles
until you found the database for this file.

note that best practice is to attach not only the mdf, but also the accompagning ldf together with the mdf.

0
 

Author Comment

by:MichaelMarom
Comment Utility
Hi angleIII,

Thanks for your answer.

I mean that, I tried to reattach the the MDF file, after I have detach it.

My problem is that, there is any process, that I don't know what is it, that uses the MDF file, and prevents me to reattach this file.
The problem is still exist, also, when I try to restart my computer.
Please tell me how to fix it.


Michael
0
 
LVL 28

Accepted Solution

by:
imran_fast earned 50 total points
Comment Utility
hi Micheal,
Try creating copy of that mdf and attach that.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
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.

763 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now