USE [Elyse_DB] GO /****** Object: Table [people].[duty_function_sid_links] Script Date: Wed 21-10-2026 4:50:15 AM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [people].[duty_function_sid_links]( [function_id] [bigint] NOT NULL, [sid_id] [bigint] NOT NULL, [created] [datetime2](7) NOT NULL, [granted_by] [nvarchar](128) NOT NULL, [valid_from] [datetime2](7) NULL, [valid_until] [datetime2](7) NULL, [notes] [nvarchar](1000) NULL, [app_reference] [nvarchar](1000) NULL, CONSTRAINT [PK_user_function_links] PRIMARY KEY CLUSTERED ( [function_id] ASC, [sid_id] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY] ) ON [PRIMARY] GO INSERT [people].[duty_function_sid_links] ([function_id], [sid_id], [created], [granted_by], [valid_from], [valid_until], [notes], [app_reference]) VALUES (12, 3, CAST(N'2026-10-10T13:52:17.7519449' AS DateTime2), N'DEMO\svc_demo', NULL, NULL, N'Linked by metadata upload', NULL) INSERT [people].[duty_function_sid_links] ([function_id], [sid_id], [created], [granted_by], [valid_from], [valid_until], [notes], [app_reference]) VALUES (13, 4, CAST(N'2026-10-10T13:52:17.7640186' AS DateTime2), N'DEMO\svc_demo', NULL, NULL, N'Linked by metadata upload', NULL) INSERT [people].[duty_function_sid_links] ([function_id], [sid_id], [created], [granted_by], [valid_from], [valid_until], [notes], [app_reference]) VALUES (14, 5, CAST(N'2026-10-10T13:52:17.7721783' AS DateTime2), N'DEMO\svc_demo', NULL, NULL, N'Linked by metadata upload', NULL) INSERT [people].[duty_function_sid_links] ([function_id], [sid_id], [created], [granted_by], [valid_from], [valid_until], [notes], [app_reference]) VALUES (15, 6, CAST(N'2026-10-10T13:52:17.7827247' AS DateTime2), N'DEMO\svc_demo', NULL, NULL, N'Linked by metadata upload', NULL) INSERT [people].[duty_function_sid_links] ([function_id], [sid_id], [created], [granted_by], [valid_from], [valid_until], [notes], [app_reference]) VALUES (16, 7, CAST(N'2026-10-10T13:52:17.7912527' AS DateTime2), N'DEMO\svc_demo', NULL, NULL, N'Linked by metadata upload', NULL) INSERT [people].[duty_function_sid_links] ([function_id], [sid_id], [created], [granted_by], [valid_from], [valid_until], [notes], [app_reference]) VALUES (17, 8, CAST(N'2026-10-10T13:52:17.7991376' AS DateTime2), N'DEMO\svc_demo', NULL, NULL, N'Linked by metadata upload', NULL) INSERT [people].[duty_function_sid_links] ([function_id], [sid_id], [created], [granted_by], [valid_from], [valid_until], [notes], [app_reference]) VALUES (18, 9, CAST(N'2026-10-10T13:52:17.8073712' AS DateTime2), N'DEMO\svc_demo', NULL, NULL, N'Linked by metadata upload', NULL) INSERT [people].[duty_function_sid_links] ([function_id], [sid_id], [created], [granted_by], [valid_from], [valid_until], [notes], [app_reference]) VALUES (19, 10, CAST(N'2026-10-10T13:52:17.8178181' AS DateTime2), N'DEMO\svc_demo', NULL, NULL, N'Linked by metadata upload', NULL) INSERT [people].[duty_function_sid_links] ([function_id], [sid_id], [created], [granted_by], [valid_from], [valid_until], [notes], [app_reference]) VALUES (20, 11, CAST(N'2026-10-10T13:52:17.8278417' AS DateTime2), N'DEMO\svc_demo', NULL, NULL, N'Linked by metadata upload', NULL) INSERT [people].[duty_function_sid_links] ([function_id], [sid_id], [created], [granted_by], [valid_from], [valid_until], [notes], [app_reference]) VALUES (21, 12, CAST(N'2026-10-10T13:52:17.8358744' AS DateTime2), N'DEMO\svc_demo', NULL, NULL, N'Linked by metadata upload', NULL) INSERT [people].[duty_function_sid_links] ([function_id], [sid_id], [created], [granted_by], [valid_from], [valid_until], [notes], [app_reference]) VALUES (22, 13, CAST(N'2026-10-10T13:52:17.8468803' AS DateTime2), N'DEMO\svc_demo', NULL, NULL, N'Linked by metadata upload', NULL) INSERT [people].[duty_function_sid_links] ([function_id], [sid_id], [created], [granted_by], [valid_from], [valid_until], [notes], [app_reference]) VALUES (23, 14, CAST(N'2026-10-10T13:52:17.8564337' AS DateTime2), N'DEMO\svc_demo', NULL, NULL, N'Linked by metadata upload', NULL) INSERT [people].[duty_function_sid_links] ([function_id], [sid_id], [created], [granted_by], [valid_from], [valid_until], [notes], [app_reference]) VALUES (24, 15, CAST(N'2026-10-10T13:52:17.8650127' AS DateTime2), N'DEMO\svc_demo', NULL, NULL, N'Linked by metadata upload', NULL) INSERT [people].[duty_function_sid_links] ([function_id], [sid_id], [created], [granted_by], [valid_from], [valid_until], [notes], [app_reference]) VALUES (24, 18, CAST(N'2026-10-10T13:52:17.8897038' AS DateTime2), N'DEMO\svc_demo', NULL, NULL, N'Linked by metadata upload', NULL) INSERT [people].[duty_function_sid_links] ([function_id], [sid_id], [created], [granted_by], [valid_from], [valid_until], [notes], [app_reference]) VALUES (25, 16, CAST(N'2026-10-10T13:52:17.8729661' AS DateTime2), N'DEMO\svc_demo', NULL, NULL, N'Linked by metadata upload', NULL) INSERT [people].[duty_function_sid_links] ([function_id], [sid_id], [created], [granted_by], [valid_from], [valid_until], [notes], [app_reference]) VALUES (26, 17, CAST(N'2026-10-10T13:52:17.8816922' AS DateTime2), N'DEMO\svc_demo', NULL, NULL, N'Linked by metadata upload', NULL) INSERT [people].[duty_function_sid_links] ([function_id], [sid_id], [created], [granted_by], [valid_from], [valid_until], [notes], [app_reference]) VALUES (27, 19, CAST(N'2026-10-10T13:52:17.8998095' AS DateTime2), N'DEMO\svc_demo', NULL, NULL, N'Linked by metadata upload', NULL) INSERT [people].[duty_function_sid_links] ([function_id], [sid_id], [created], [granted_by], [valid_from], [valid_until], [notes], [app_reference]) VALUES (28, 20, CAST(N'2026-10-10T13:52:17.9073194' AS DateTime2), N'DEMO\svc_demo', NULL, NULL, N'Linked by metadata upload', NULL) GO ALTER TABLE [people].[duty_function_sid_links] ADD CONSTRAINT [DF_duty_function_sid_links_created] DEFAULT (sysdatetime()) FOR [created] GO ALTER TABLE [people].[duty_function_sid_links] ADD CONSTRAINT [DF_duty_function_sid_links_granted_by] DEFAULT (original_login()) FOR [granted_by] GO ALTER TABLE [people].[duty_function_sid_links] WITH CHECK ADD CONSTRAINT [FK_sid_link_to_user_function] FOREIGN KEY([sid_id]) REFERENCES [user_restr].[sid_list] ([sid_id]) GO ALTER TABLE [people].[duty_function_sid_links] CHECK CONSTRAINT [FK_sid_link_to_user_function] GO ALTER TABLE [people].[duty_function_sid_links] WITH CHECK ADD CONSTRAINT [FK_user_function_link_to_sid] FOREIGN KEY([function_id]) REFERENCES [people].[duty_functions] ([function_id]) GO ALTER TABLE [people].[duty_function_sid_links] CHECK CONSTRAINT [FK_user_function_link_to_sid] GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Links duty functions to SIDs. COPYRIGHT NOTICE This database schema and stored procedures are protected by copyright. Copyright. Silkwood Software Pty. Ltd. 2023' , @level0type=N'SCHEMA',@level0name=N'people', @level1type=N'TABLE',@level1name=N'duty_function_sid_links' GO