How do I insert 800000 records into an MS Access table?

前端 未结 16 1040
故里飘歌
故里飘歌 2020-12-17 04:13

I need to insert 800000 records into an MS Access table. I am using Delphi 2007 and the TAdoXxxx components. The table contains some integer fields, one float f

16条回答
  •  借酒劲吻你
    2020-12-17 04:38

    You're looking in the right direction in one way. Using a single statement to bulk insert will be faster than trying to iterate through the data and insert it row by row. Access, being a file-based database will be exceedingly slow in iterative writes.

    The problem is that Access is handling how it optimizes writes internally and there's not really any way to control it. You've probably reached the maximum efficiency of an INSERT statement. For additional speed, you should probably evaluate if there's any way around writing 800,000 records to the database every time you start the application.

提交回复
热议问题