You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-- Example resultant dates into @CaseloadTimeframeStartDate
90
+
-- With
91
+
-- @CaseloadLastSept30th = 30th September 2023
92
+
-- @CaseloadTimeframeStartDate = 30th September 2017
115
93
116
-
-- -- META-ELEMENT: {"type": "dbschema"}
117
-
-- -- SQL Server variant for review
118
-
-- -- Point to DB/TABLE_CATALOG if required (SSD tables created here)
119
-
-- USE HDM_Local; -- used in logging (and seperate clean-up script(s))
120
-
-- DECLARE @schema_name NVARCHAR(128) = N'ssd_development'; -- set your schema name here OR leave empty for default behaviour. Used towards ssd_extract_log
121
94
122
-
-- -- META-ELEMENT: {"type": "test"}
123
-
-- DECLARE @TableName NVARCHAR(128) = N'table_name_placeholder'; -- Note: also/seperately use of @table_name in non-test|live elements of script.
124
95
125
96
97
+
-- META-ELEMENT: {"type": "dbschema"}
98
+
-- Point to DB/TABLE_CATALOG if required (SSD tables created here)
99
+
USE HDM_Local; -- used in logging (and seperate clean-up script(s))
100
+
DECLARE @schema_name NVARCHAR(128) =N'ssd_development'; -- set your schema name here OR leave empty for default behaviour. Used towards ssd_extract_log
101
+
102
+
ALTER USER [ESCC\RobertHa] WITHDEFAULT_SCHEMA= [ssd_development];
103
+
104
+
105
+
-- META-ELEMENT: {"type": "test"}
106
+
DECLARE @TableName NVARCHAR(128) =N'table_name_placeholder'; -- Note: also/seperately use of @table_name in non-test|live elements of script.
pers_sex NVARCHAR(20), -- metadata={"item_ref":"PERS002A", "item_status":"P", "info":"If additional status to Gender is held, otherwise dup of pers_gender"}
pers_sex, -- sex and gender currently extracted as one
253
243
pers_gender, --
254
244
pers_ethnicity,
@@ -304,7 +294,7 @@ INSERT INTO ssd_development.ssd_person (
304
294
-- WHERE
305
295
-- p.DIM_PERSON_ID IS NOT NULL
306
296
-- AND p.DIM_PERSON_ID <> -1
307
-
-- -- AND YEAR(p.BIRTH_DTTM) != 1900
297
+
-- -- AND YEAR(p.BIRTH_DTTM) != 1900 -- #DtoI-1814
308
298
-- AND (p.IS_CLIENT = 'Y'
309
299
-- OR (
310
300
-- EXISTS (
@@ -338,7 +328,7 @@ INSERT INTO ssd_development.ssd_person (
338
328
-- WHERE (fi.DIM_PERSON_ID = p.DIM_PERSON_ID
339
329
-- AND (fi.DIM_LOOKUP_INVOLVEMENT_TYPE_CODE NOT LIKE 'KA%' --Key Agencies (External)
340
330
-- OR fi.DIM_LOOKUP_INVOLVEMENT_TYPE_CODE IS NOT NULL OR fi.IS_ALLOCATED_CW_FLAG = 'Y')
341
-
-- AND START_DTTM > '2009-12-04 00:54:49.947' -- was trying to cut off from 2010 but when I changed the date it threw up an erro
331
+
---- AND START_DTTM > '2009-12-04 00:54:49.947' -- #DtoI-1830 care leavers who were aged 22-25 and may not have had Allocated Case Worker relationship for years+.
342
332
-- AND DIM_WORKER_ID <> '-1'
343
333
-- AND (fi.END_DTTM IS NULL OR fi.END_DTTM > GETDATE()))
344
334
-- )
@@ -349,6 +339,7 @@ INSERT INTO ssd_development.ssd_person (
0 commit comments