M
Michael Bray
I'm trying to import a large dataset (300,000 lines of delimited text) into
a SQL database with ADO.NET. I've run into a few issues -
Performance - the inserts ran very fast for the first 50,000 records or so,
but have slowed down significantly by the time they had inserted around
100,000 records. I am using a DataSet representation of the SQL database
and using the .AddtblXXXRow() to get a row, then setting each value, and
calling Update() on the TableAdapter for each row.
Logic - I was originally only calling Update() after every 500 AddtblXXXRow
()'s had been collected, and it seemed to work, but then it stopped working
after I deleted all the data from the tables, reseeded the identity column,
and tried to do it every 1000 inserts instead. I even went so far as to
completely rebuild the database but it still failed. The error I was
getting on the Update() was that the value in the primary key already
existed in the database.
Any ideas on these two? I think the performance issue might be due to
index maintenance - is there any way to suspend updating of indexes until
all the inserts are complete? I have no idea about the logic issue,
because it had been working and then it just seemed to stop working.
TIA!
-mdb
a SQL database with ADO.NET. I've run into a few issues -
Performance - the inserts ran very fast for the first 50,000 records or so,
but have slowed down significantly by the time they had inserted around
100,000 records. I am using a DataSet representation of the SQL database
and using the .AddtblXXXRow() to get a row, then setting each value, and
calling Update() on the TableAdapter for each row.
Logic - I was originally only calling Update() after every 500 AddtblXXXRow
()'s had been collected, and it seemed to work, but then it stopped working
after I deleted all the data from the tables, reseeded the identity column,
and tried to do it every 1000 inserts instead. I even went so far as to
completely rebuild the database but it still failed. The error I was
getting on the Update() was that the value in the primary key already
existed in the database.
Any ideas on these two? I think the performance issue might be due to
index maintenance - is there any way to suspend updating of indexes until
all the inserts are complete? I have no idea about the logic issue,
because it had been working and then it just seemed to stop working.
TIA!
-mdb