How can I copy the SQL Server Database Data File (mdf)

  • Krishna Potlakayala (3/28/2009)


    You can't copy the .mdf file if the server is online.

    "Au contrair mon pere"

    you dont need to shutdown sql server!

    you dont need to detach the database!

    you dont even need to back it up and restore it!

    For the database you wish to retrieve, ensure no users are connected and then issue

    alter database [mydatabase] set offline

    copy the disk files (mdf and ldf) then bring back online using

    alter database [mydatabase] set online

    😉

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

    "Ya can't make an omelette without breaking just a few eggs" 😉

  • Perry Whittle (4/8/2009)


    "Au contrair mon pere"

    😉

    Haven't heard that in "forever". Thanks for the early morning laugh....

    -- You can't be late until you show up.

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

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