Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Need help designing big database update process

We have a database with ~100K business objects in it. Each object has about 40 properties which are stored amongst 15 tables. I have to get these objects, perform some transforms on them and then write them to a different database (with the same schema.) This is ADO.Net 3.5, SQL Server 2005.

We have a library method to write a single property. It figures out which of the 15 tables the property goes into, creates and opens a connection, determines whether the property already exists and does an insert or update accordingly, and closes the connection.

My first pass at the program was to read an object from the source DB, perform the transform, and call the library routine on each of its 40 properties to write the object to the destination DB. Repeat 100,000 times. Obviously this is egregiously inefficent.

What are some good designs for handling this type of problem?

Thanks

like image 514
Sisiutl Avatar asked Jul 05 '26 04:07

Sisiutl


2 Answers

This is exactly the sort of thing that SQL Server Integration Services (SSIS) is good for. It's documented in Books Online, same as SQL Server is.

like image 143
John Saunders Avatar answered Jul 09 '26 07:07

John Saunders


Unfortunately, I would say that you need to forget your client-side library, and do it all in SQL.

like image 31
Cade Roux Avatar answered Jul 09 '26 06:07

Cade Roux