Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Post Method really slow!!! 1

Status
Not open for further replies.

troyu

Programmer
Nov 21, 2000
185
CA
I have the post statement within my Delphi code. The statement is TABLE_GIFTACT.POST.

The code goes through a loop, and posts records into a table (currently has 1,000,000 records).

There are 2 key fields within the table. In SQL Server back-end, there was one index created for this table, the index has the 2 key fields as a combined index.

The problem is the post is EXTREMELY SLOW!!! The user is trying to post about 70,000 records into the table, and the thing just sits there, and eventually freezes up.
HELP!!!!!

I am using Delphi 1.0.
 
Are you able to use a query fed with the SQL statement to feed directly from one table to another ? Are you using only tables in a SQL server database ?
In which case you can use something like :
'INSERT INTO [Table1]
(Field1, Field2, Field3, ....)
SELECT Field5, Field6, Field7, .... FROM [Table2])'
I've found that this is incredibly faster than cycling through one result set and feeding it through to another.
Hope this solution is usable in your case.
Steve
 
That's a lot of records, so it probably is really slow... do you have Application.ProcessMessages inside the loop to make sure it doesn't show as "not responding" to windows while it's updating? TealWren
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top