Describe the bug
In [dbo].[sqlwatch_meta_agent_job] there is a behavior that creates a lot of duplicate record. This can lead to unexpected results. I want to fix this.
To Reproduce
Steps to reproduce the behavior:
Install SQLWATCH and recreate jobs with same name.
Windows Server (please complete the following information):
OS Version: Windows Server 2019
SQL Server (please complete the following information):
SQL Version: SQL Server 2019 CU11
SQL Edition: Enterprise Core
SQLWATCH version (from DACPAC or from sysinstances)
4.3.0.0
Additional context
My suggestions. I will create a pull request for your evaluation.
[dbo].[vw_sqlwatch_report_dim_agent_job] - add predicate WHERE [is_record_deleted] = 0 or [is_record_deleted] is null
I explain this so that procedures can only work with an up-to-date list of jobs ([dbo].[usp_sqlwatch_internal_expand_checks], for example).
[dbo].[usp_sqlwatch_internal_add_job] - add to the first merge
when not matched by source then
update set
[is_record_deleted] = 1
Describe the bug In [dbo].[sqlwatch_meta_agent_job] there is a behavior that creates a lot of duplicate record. This can lead to unexpected results. I want to fix this.
To Reproduce Steps to reproduce the behavior:
Windows Server (please complete the following information):
SQL Server (please complete the following information):
SQLWATCH version (from DACPAC or from sysinstances)
Additional context My suggestions. I will create a pull request for your evaluation. [dbo].[vw_sqlwatch_report_dim_agent_job] - add predicate
WHERE [is_record_deleted] = 0 or [is_record_deleted] is null
I explain this so that procedures can only work with an up-to-date list of jobs ([dbo].[usp_sqlwatch_internal_expand_checks], for example).[dbo].[usp_sqlwatch_internal_add_job] - add to the first merge