web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

Importing more than 200k records takes more than 2 hours

(1) ShareShare
ReportReport
Posted on by 6
Hi all, 

Every day the system will receive 5 files of different types. These files have more than 200k records/each. I want to import these files into BC and then explode them with another table to put the data that these files have.

The files are in .csv with 10 columns each.
What I have worked on so far have been two ways of importing the file into a Stagging file and then with a job queue to read the records, and then insert the lines into a Price Stagging.
1. Reading the file with xmlport and inserting records in price staging, and
2. Since the columns of the file are different, I used Data exchange definition for fields mapping and insertion in file staging.
 
But both methods are not efficient as the import takes more than 2 hours of time.
Is there a more efficient way to import?
 
 
P.s.: Not all lines imported into the staging table will be inserted into the final table.
  • Suggested answer
    YUN ZHU Profile Picture
    103,712 Super User 2026 Season 2 on at
    Hi, As far as I know, there are three ways to import CSV: XMLPort, CSV Buffer, and Power Automate. You can try other methods.
    More details: 
     
    But this should be caused by the quantity. If the number of imports can be reduced, I think the efficiency will be greatly improved, or try to split the files.
     
    Hope this can give you some hints.
    Thanks.
    ZHU
  • Matteo Fiocco Profile Picture
    260 on at
    Hi,
     
     

    Optimize the XMLport or Data Exchange Definition

    • Batch Processing: Instead of processing all records in one go, consider batching the records. This can help manage memory usage better.
    • Buffer Table Usage: Use a buffer table to temporarily hold data during the import process, reducing the overhead during insertion into the final staging tables.
    • Minimize Data Transformation: Ensure that any data transformation is done after the initial import to the staging table, rather than during the file import.

    Use .NET Interoperability for File Reading

    • System.IO for Fast File Reading: Instead of relying solely on XMLports or Data Exchange Definitions, you can use .NET interoperability to read the file directly into memory. The System.IO.StreamReader class can read large files more efficiently.
    • Bulk Insert Techniques: After reading the file into memory, you can process the data and insert it in bulk into the staging table using AL code. This can significantly reduce the time taken to insert records.

    Parallel Processing

    • Split Files: If possible, split the large files into smaller chunks and process them in parallel using separate job queue entries or background sessions. This distributes the workload and speeds up the overall process.
    • Multi-Threading: Though Business Central runs on a single-threaded AL runtime, you can simulate parallelism by queuing multiple imports simultaneously if your infrastructure supports it.

    SQL Server Integration

    • Direct SQL Integration: For very large datasets, consider using SQL Server Integration Services (SSIS) or directly writing to the Business Central database tables via SQL (with caution). This method requires a deep understanding of Business Central’s database schema and must be used carefully to maintain data integrity.
     
     
     
  • Jun Wang Profile Picture
    8,222 Moderator on at
    you could search a 3rd party app to import data into BC.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 740 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 570 Super User 2026 Season 2

#3
Grigorios Mavrogeorgis Profile Picture

Grigorios Mavrogeorgis 291 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans