I figured I would turn to TWW to see if anyone has any suggestions, I am running low on them.I have a huge dataset (50 million rows) in Table A that needs to be moved to Table B in SQL 2008.Table A has to have some stuff done to it programmatically, so it has to be processed somehow in .net.Table A also has very few constraints on it, whereas Table B has stricter constraints.I would like to know which specific rows from Table A get excepted out by Table B.The slowest, easiest method is to read Table A into a dataset, and roll through it, formatting an Insert statement for each row and inserting it into Table B. If the row throws an exception, log that somewhere. This runs at around 1500 records per second.The next fastest I have found is by using two dataadapters, a data set with two tables, and moving the data from Dataset A to Dataset B, then doing DataAdapterB.Update. Do this on chunks of like 100,000 records, to keep it from timing out or running out of memory. This runs at around 2000-2500 records per second.The ultimate in speed I found was to use a SqlBulkCopy object. This runs at around 8000 records per second. The caveat here is that the data being copied has to fit within the constraints of table B, or the entire bulk operation fails, I also lose row level reporting on exceptions.Does anyone know of any faster ways of obtaining the goal? This is starting to frustrate the hell out of me.
3/24/2009 9:33:41 PM
Not specificallyBut I'd probably use the SqlBulkCopy. When a bulk fails, split it and repeat a few times maybe, then take the failing bulks and go through those row by row.[Edited on March 24, 2009 at 9:38 PM. Reason : seems like something should do that for you though]
3/24/2009 9:36:55 PM
been there, feel your pain. don't really have any great suggestions
3/24/2009 9:40:32 PM
just copy paste that shit
3/24/2009 9:45:13 PM
3/24/2009 9:48:56 PM
Thanks for the suggestions so far, to answer your questions:
3/24/2009 10:15:55 PM