For CSV:
- Create a Blob Storage dataset with dynamic content in the file path to incorporate the "Region" value, allowing for different files per region.
For SQL Tables:
- Create a dataset for your Azure SQL Database with dynamic content in the table name to include the "Region" value, creating separate tables per region.
Then, use a Lookup activity in your pipeline to retrieve distinct "Region" values from your source table. This activity will output a list of regions that you can iterate over.
Wrap a Copy Data activity within a ForEach activity.
The ForEach should iterate over the distinct "Region" values obtained from the Lookup activity. Pass each value as a parameter to both your source and sink datasets, ensuring data is filtered and stored according to the "Region".
To maintain synchronization with your source table, consider implementing a trigger-based mechanism by enabling change tracking on your Azure SQL Database. You can use a stored procedure or a query to identify changes (insertions, updates, deletions) since the last pipeline run.
And you can configure your pipeline to perform incremental loads instead of full refreshes to only process rows that have been inserted, updated, or deleted since your last pipeline execution.