In order to prevent administrators from having to create a new connection string for each client database, the server event OnEtlExecuteStart was created. The event is triggered at the start of an ETL Job execution. This server event allows administrators to define any number of databases and data connection strings that are required to run by running the same transform in a loop for as many databases and connection strings as needed.
For more information on the ETL module (available in versions v2019.1+), please see this article.
For custom code the args array is structured as follows:
args contains one argument, an ETL Tenant Collection object representing the ETL Job execution.
For .NET Assemblies the method signature is as follows:
bool EventHandlerName(SessionInfo sessionInfo, EtlTenantCollection etlTenants)
The OnEtlExecuteStart Event expects a boolean return value. Return true to continue the ETL Job execution, return false to abort.
Clearing Data When Tenanting
The ETL Tenant Collection object has two properties that allow for finer control over how data is cleared during tenanting: ClearDataOnFirstTenant and ClearDataBetweenTenants.
ClearDataOnFirstTenant is enabled, the existing data on the data table will be cleared before the ETL Job executes for the first tenant. When ClearDataBetweenTenants is enabled, the existing data will be cleared for each new tenant, allowing the same transform to update data for multiple different client databases.
These properties take priority over the Clear Existing Data on Execute setting. If either of these properties are set to true, the selection for this setting will be ignored.