|
Posted by Erland Sommarskog on 02/15/07 22:39
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@sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
[Back to original message]
|