ms sql database file direct copy

Posted on 2008-11-06
Last Modified: 2011-10-03

can i do direct copy of ms sql database files to backup tape or hdd ?

or i need to follow specific procedure to copy the sql database ?

pls provide the procedure as i am very new to database and sql


Question by:techsysnet
    LVL 31

    Accepted Solution

    LVL 31

    Expert Comment

    by:James Murrell
    LVL 3

    Assisted Solution

    I'd allways recommend that you do a proper backup using the Enterprise Manager or by scripting it. However you can copy the databasefiles directly as well, in this case you'll need to detach the database - again through Enterprise Manager or by scripts - before you copy the files.

    You'll need both the .mdf and .ldf files.

    1. Detach the database.
    2. Copy <myDatabase>.mdf and <myDatabase>_log.ldf to desired location.
    3. Attach the database again.

    Let me know if you want scripts to do automatic backup/restore of the database, it is a much cleaner solution, and you won't need to take the database offline while you do it.

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Join & Write a Comment

    Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
    International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
    Viewers will learn how the fundamental information of how to create a table.
    Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

    754 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

    18 Experts available now in Live!

    Get 1:1 Help Now