U
Urs Eichmann
My Program needs to insert about 6 Mio records into a large table on SQL
Server 2000 which already has 2 or 3 Mio records. It uses a DataAdapter
to insert 100 records at a time.
About every 2 or 3 hours, the DataAdapter.Update fails with a timeout
exeption (SqlException "Timeout expried. the timeout period elapsed
prior to completion of the operation or the server is not responding".
I used SQL profiler to fetch the latest INSERT INTO statement of th
dataadapter. If I run that INSERT INTO statement in SQL Query analyzer,
I notice that the command actually succeeds, but it takes 2 or 3 minutes
to complete.
I guess that SQL Server is growing the db size during this time. The
problem is - how can I make the dataadapter wait for the command to
complete?
I used DataAdapter.UpdateCommand.CommandTimeout = 600 right before the
DataAdapter.Update command, but it still returns after about 30 seconds
with a timeout exception.
I also tried to catch the exception, and reissue the update command if
the exception occurs. This doesn't help either - the update will fail
again and again.
Thanks for your help
Urs
Server 2000 which already has 2 or 3 Mio records. It uses a DataAdapter
to insert 100 records at a time.
About every 2 or 3 hours, the DataAdapter.Update fails with a timeout
exeption (SqlException "Timeout expried. the timeout period elapsed
prior to completion of the operation or the server is not responding".
I used SQL profiler to fetch the latest INSERT INTO statement of th
dataadapter. If I run that INSERT INTO statement in SQL Query analyzer,
I notice that the command actually succeeds, but it takes 2 or 3 minutes
to complete.
I guess that SQL Server is growing the db size during this time. The
problem is - how can I make the dataadapter wait for the command to
complete?
I used DataAdapter.UpdateCommand.CommandTimeout = 600 right before the
DataAdapter.Update command, but it still returns after about 30 seconds
with a timeout exception.
I also tried to catch the exception, and reissue the update command if
the exception occurs. This doesn't help either - the update will fail
again and again.
Thanks for your help
Urs