Data Files (mdf)

  • Hi 

    Is it possible to  combine two or three  database mdf files to one file.

    Thanks

  • tmmutsetse - Tuesday, February 13, 2018 7:41 AM

    Hi 

    Is it possible to  combine two or three  database mdf files to one file.

    Thanks

    Yes. But once you've done that, nothing will be able to read the file.


  • You can copy the data/tables from to your primary mdf file.

    How? That depends on your current configuration.
    If you post your databases DDL (create database statement) we may be able to point you a route.

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data/code to get the best help[/url]

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution 😀

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me

  • For same DB and same filegroup,  you can DBCC SHRINKFILE with EMPTYFILE option, then drop the empty data file.

    GASQL.com - Focus on Database and Cloud

  • Alexander Zhang - Tuesday, February 13, 2018 3:31 PM

    For same DB and same filegroup,  you can DBCC SHRINKFILE with EMPTYFILE option, then drop the empty data file.

    If you're going to recommend such a thing, then you also need to identify all the nasty stuff that happens along with that recommendation.

    --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)

  • Lj Burrows - Monday, February 19, 2018 5:47 AM

    Yes you can merge two or more database to one by restoring the databases which you want to merge and another way is to use third-party SQL Recovery Software, which is easy and fast solution that will help you in merging the two different SQL MDF file databases.

    How does restoring databases facilitate their merge?
    I do not see anywhere on the SQL Recovery Software site which talks about merging databases.


Viewing 6 posts - 1 through 6 (of 6 total)

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