• It's a long shot and it doesn't always work but I've had some success in the past with such a thing.

    1. Make sure the database in question is detached and that the MDF file is in a safe place. "Safe place" means NOT on the drive that you normally store your MDF files, in this case.

    2. Create a new database with the same name as the database in question. Note that the logical and physical file names should match the old ones.

    3. Properly detach the new database.

    4. Copy (not move) the old MDF file from Step 1 over the new MDF file created in Steps 2 and 3.

    5. Try to reattach the new database.

    It doesn't always work but the answer is always "No" unless you "ask".

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)