diff --git a/cms_ssd_extract_sql/systemc/liquidlogic_sqlserver_v1.1.9_1_20240719.sql b/cms_ssd_extract_sql/systemc/liquidlogic_sqlserver_v1.1.9_1_20240719.sql index 31b4308..9322cc3 100644 --- a/cms_ssd_extract_sql/systemc/liquidlogic_sqlserver_v1.1.9_1_20240719.sql +++ b/cms_ssd_extract_sql/systemc/liquidlogic_sqlserver_v1.1.9_1_20240719.sql @@ -898,6 +898,7 @@ WHERE EXISTS SELECT 1 FROM ssd_development.ssd_person p WHERE CAST(p.pers_person_id AS INT) = fls.DIM_PERSON_ID -- #DtoI-1799 + AND fls.END_DTTM >= DATEADD(YEAR, -@ssd_timeframe_years, GETDATE()) OR NULL -- #DtoI-1806 ); IF @Run_SSD_As_Temporary_Tables = 0 @@ -4556,6 +4557,7 @@ WHERE SELECT 1 FROM ssd_development.ssd_person sp WHERE sp.pers_person_id = cs.dim_person_id + AND (sp.end_date IS NULL OR sp.end_date > GETDATE()) -- #DtoI-1806 ); -- Example entry 2 diff --git a/cms_ssd_extract_sql/systemc/liquidlogic_sqlserver_v1.1.9_1_20240719_temp.sql b/cms_ssd_extract_sql/systemc/liquidlogic_sqlserver_v1.1.9_1_20240719_temp.sql index 4c65387..696faec 100644 --- a/cms_ssd_extract_sql/systemc/liquidlogic_sqlserver_v1.1.9_1_20240719_temp.sql +++ b/cms_ssd_extract_sql/systemc/liquidlogic_sqlserver_v1.1.9_1_20240719_temp.sql @@ -58,7 +58,7 @@ GO DECLARE @sql NVARCHAR(MAX) = N''; DECLARE @Run_SSD_As_Temporary_Tables BIT; -SET @Run_SSD_As_Temporary_Tables = 0; -- 1==Single use SSD extract uses tempdb..# | 0==Persistent SSD table set up +SET @Run_SSD_As_Temporary_Tables = 1; -- 1==Single use SSD extract uses tempdb..# | 0==Persistent SSD table set up