SQL 2008 detach then attach and db not found

Posted on 2011-04-20
Last Modified: 2012-05-11
I detached a db and then changed nothing and went to attach it back and it can't be found. The files now don't seem to have the correct file type associated with them. They were locked originally after detaching with the little lock button and by setting permissions to inherit from parent I was able to get that fixed but still they don't show up.
Question by:biotec
    LVL 9

    Expert Comment

    try to search dbname.mdf file with extension "mdf" in your system and once found, use it to re-attach

    Author Comment

    That's just it, I'm not sure it has the right .mdf extension. They don't seem to show up when searching for .mdf it's as if the system doesn't know what file type it is.
    LVL 9

    Accepted Solution

    if you detach the db, your .mdf file should reside where it was earlier similar in this location
    C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data

    try here

    Author Comment

    I know where the file is. It is in the exact same location I originally installed it in. It's just not recognized.

    Author Closing Comment

    I had to add the file extension in by renaming the files. That is weird but it worked. Thanks

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    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.

    I was supporting a handful of Windows 2008 (non-R2) 2 node clusters with shared quorum disks. Some had SQL 2008 installed and some were just a vendor application that we supported. For the purposes of this article it doesn’t really matter which so w…
    The recent Microsoft changes on update philosophy for Windows pre-10 and their impact on existing WSUS implementations.
    This tutorial will walk an individual through the steps necessary to install and configure the Windows Server Backup Utility. Directly connect an external storage device such as a USB drive, or CD\DVD burner: If the device is a USB drive, ensure i…
    This tutorial will walk an individual through setting the global and backup job media overwrite and protection periods in Backup Exec 2012. Log onto the Backup Exec Central Administration Server. Examine the services. If all or most of them are stop…

    760 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