简体   繁体   中英

SSIS: import data from excel to sql server database with file last modified date condition

My goal is to build automatic process, which imports data from multiple xlsx files from certain directory to sql server database in regular phases.

I already created SSIS package, which imports data to sql server database. But everytime if I run this package, all xlsx files data will be inserted, but I would not like to import all data again, I would like to import just those xlsx files again, which have been updated after last import.

Currently my data flow is following:
Excel source > OLE DB Destination which runs inside foreach loop container.

I imagine something like that:
I have to insert last import timestamp with file name into some log table and then have to compare it with the xlsx last modified date. But I do not know how to do it. Hope that someone could provide some step by step instructions.

This link will give you step by step answer. You need to take care about flat file connection to excel file connection and join based on last modified date column.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM