Detecting Detached Databases

  • Jeff Moden

    SSC Guru

    Points: 995648

    AllegedDBA wrote:

    I know this an older thread, but in case anyone's still looking, Chrissy and Friends over at have it covered:  

    I could certainly be incorrect but that looks like you need to already know the path and file name.  The original post was about how to find them.

    That, notwithstanding, that looks like some pretty awesome code that does interrogate a known MDF file quite nicely.  Thanks for posting the link.

    --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.
    "If you think its expensive to hire a professional to do the job, wait until you hire an amateur."--Red Adair
    "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)

  • AllegedDBA


    Points: 5

    Quite right, sir.  The script is dandy, but doesn't address the OP's question.  It looks like the script posted by the OP and tweaked by Jack 95169 will do so.  If your situation allows you to enable xp_cmdshell, that is. 😉

    "If the women don't find you handsome, they should at least find you handy." Red Green

Viewing 2 posts - 16 through 17 (of 17 total)

You must be logged in to reply to this topic. Login to reply