Skip to content

Commit c5cbe83

Browse files
committed
re-added missing declarer / table def
1 parent 0b478c6 commit c5cbe83

File tree

2 files changed

+61
-0
lines changed

2 files changed

+61
-0
lines changed

deployment_extracts/eclipse/live/ssd_deployment_individual_files_tsql/ssd_person copy.sql renamed to deployment_extracts/eclipse/live/ssd_deployment_individual_files_tsql/ssd_person BAK.sql

File renamed without changes.

deployment_extracts/eclipse/live/ssd_deployment_individual_files_tsql/ssd_person.sql

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,64 @@
1+
-- META-CONTAINER: {"type": "table", "name": "ssd_person"}
2+
-- =============================================================================
3+
-- Description: Person/child details.
4+
-- Author: D2I
5+
-- Version: 0.2 Fixed run order and ; use
6+
-- 0.1: new RH
7+
-- Status: [D]ev
8+
-- Remarks: [EA_API_PRIORITY_TABLE]
9+
10+
-- Dependencies:
11+
-- - PERSONVIEW
12+
-- - PERSONDEMOGRAPHICSVIEW
13+
-- - REFERENCENUMBERPERSONVIEW
14+
-- - CLASSIFICATION, CLASSIFICATION_GROUP, CLASSIFICATION_ASSIGNMENT
15+
-- - SUBJECT_CLASSIFICATION_ASSIGNM, PERSON_CLASSIFICATION_ASSIGNME
16+
-- - PERSON_PER_RELATIONSHIP, RELATIONSHIP_TYPE
17+
-- =============================================================================
18+
19+
20+
/* META-ELEMENT: {"type": "drop_table"} */
21+
IF OBJECT_ID('tempdb..#ssd_person', 'U') IS NOT NULL DROP TABLE #ssd_person;
22+
23+
IF OBJECT_ID('ssd_person', 'U') IS NOT NULL
24+
BEGIN
25+
IF EXISTS (SELECT 1 FROM ssd_person)
26+
TRUNCATE TABLE ssd_person;
27+
END
28+
ELSE
29+
BEGIN
30+
/* META-ELEMENT: {"type": "create_table"} */
31+
CREATE TABLE ssd_person (
32+
pers_legacy_id NVARCHAR(48), -- metadata={"item_ref":"PERS014A", "info": "Legacy systems identifier. Common to SystemC"}
33+
pers_person_id NVARCHAR(48) PRIMARY KEY, -- metadata={"item_ref":"PERS001A"}
34+
pers_upn NVARCHAR(13), -- metadata={"item_ref":"PERS006A"}
35+
pers_forename NVARCHAR(100), -- metadata={"item_ref":"PERS015A"}
36+
pers_surname NVARCHAR(255), -- metadata={"item_ref":"PERS016A"}
37+
pers_sex NVARCHAR(20), -- metadata={"item_ref":"PERS002A"}
38+
pers_gender NVARCHAR(10), -- metadata={"item_ref":"PERS003A"}
39+
pers_ethnicity NVARCHAR(48), -- metadata={"item_ref":"PERS004A"}
40+
pers_dob DATETIME, -- metadata={"item_ref":"PERS005A"}
41+
pers_single_unique_id NVARCHAR(48), -- metadata={"item_ref":"PERS013A"}
42+
pers_upn_unknown NVARCHAR(6), -- metadata={"item_ref":"PERS007A"}
43+
pers_send_flag NCHAR(5), -- metadata={"item_ref":"PERS008A"}
44+
pers_expected_dob DATETIME, -- metadata={"item_ref":"PERS009A"}
45+
pers_death_date DATETIME, -- metadata={"item_ref":"PERS010A"}
46+
pers_is_mother NCHAR(1), -- metadata={"item_ref":"PERS011A"}
47+
pers_nationality NVARCHAR(48) -- metadata={"item_ref":"PERS012A"}
48+
);
49+
END
50+
51+
52+
/* Cohort filter list, optional
53+
Replace placeholders with real IDs, adjust type if PERSONID is numeric on your system
54+
*/
55+
DECLARE @allowed_persons TABLE (personid NVARCHAR(48) NOT NULL PRIMARY KEY);
56+
INSERT INTO @allowed_persons (personid)
57+
VALUES
58+
(N'EG111111'), (N'EG222222'), (N'EG333333'); -- swap to live record IDs, or delete these rows to disable filtering
59+
60+
61+
162
/* META-ELEMENT: {"type": "insert_data"} */
263
;WITH EXCLUSIONS AS (
364
SELECT CONVERT(NVARCHAR(48), PV.PERSONID) AS PERSONID

0 commit comments

Comments
 (0)