- We would like you to add a sanity check step in the Sql Server Agent Job Step to compare the record counts in the source tables/views and the corresponding fact/dimension tables every time the job is run (need to add this step at end after all Dim and Facts tables loaded). The record counts at the source and the target should match after the package is run. In case of mismatch, we would need an alert via email and this will enable us to perform necessary analysis and take an appropriate action immediately.
Currently this check is required for only specific tables .
how to compare record count between source and target? and how to send an email thru sql server agent if there is any mismatch in rowcount?
If there is a mismatch for any given tables, an email should be sent with the below details:
1) Name of the table2) Record Count at the Source vs Target before the Job started3) Record Count at the Source vs Target after the Job completed