Attach and Detach Database history

  • Hi There,

    Is there any way I can find Attach and Detach Database history in SQL SERVER ?

    Actually one of our developer has detached database from SQL Instance but he doesn't know the .mdf file of database and in "DATA" folder has 100s

    of other database files.

    So I am not sure which one I have to attached it back.

    Any Help , Much appreciated.

    Thanks

    Regards

    Hemesh.

  • I don't think this is in the default trace but worth a check.

    Otherwise best bet is from the backup history for the database. If you have a backup run restore filelistonly this will give you the .mdf name.

    Else the information is in msdb..backupfile table, join it to msdb..backupset.

    ---------------------------------------------------------------------

  • ..........or you could just restore the backup 🙂

    ---------------------------------------------------------------------

  • At Last I used the same option.

    Thanks for your reply.

Viewing 4 posts - 1 through 3 (of 3 total)

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