It sounds like you're about on the right track. There are a couple patterns you could do here:
- Use the
Use SQL query once per page of recordsor theUse SQL query once per recordoption on your import to pass data to a stored procedure where it handles everything. - Have one flow that exports all of your data and uses the
Use bulk insert SQL query (recommended)option to load all if to a staging table. After that, use theNext integration flowoption in the flow settings to run a second flow after this first flow finishes. The second flow would have a simple export that just exports a single record (by doing select 1 or count(*) from table). Then the import on that second flow triggers a stored procedure or runs a merge/insert/update command. - If you want a complex pattern to put it all on 1 flow, you could also do this, where you have an import to batch insert to staging, then another import that runs after everything is loaded.