Merging contents of one db to another huge db.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Chandra

    Merging contents of one db to another huge db.

    I am storing data temporarily in a database... and periodically need
    to update that huge database, so just has to copy that temp DB to the
    original one.

    Using sql may take a few hours to finish this operation. I think you
    can do "export" from temp database into a file and "import" into the
    huge database. That will be binary data exort and import and hence
    will be faster. But, I am not sure if all databases will support that
    though.

    So, is there any other solution?

  • Erland Sommarskog

    #2
    Re: Merging contents of one db to another huge db.

    Chandra (bschandramohan @gmail.com) writes:
    I am storing data temporarily in a database... and periodically need
    to update that huge database, so just has to copy that temp DB to the
    original one.
    >
    Using sql may take a few hours to finish this operation. I think you
    can do "export" from temp database into a file and "import" into the
    huge database. That will be binary data exort and import and hence
    will be faster. But, I am not sure if all databases will support that
    though.
    If the databases are on the same server, I don't think it will be
    faster to bounce the data over disk files.

    But it's important when you load the data, that you use set-based
    statement not run a loop to add one row at a time. If you inser a lot
    of data, it can however be a good idea to take things in batches of
    10000 rows at a time. Just make sure that batch things in a way so
    that the target database stays transactionally consistent.


    --
    Erland Sommarskog, SQL Server MVP, esquel@sommarsk og.se

    Books Online for SQL Server 2005 at

    Books Online for SQL Server 2000 at

    Comment

    Working...