USE [Elyse_DB] GO /****** Object: Table [user_restr].[user_privilege_log] Script Date: Wed 21-10-2026 4:50:15 AM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [user_restr].[user_privilege_log]( [primary_key] [bigint] IDENTITY(1,1) NOT NULL, [privilege_type] [nvarchar](50) NOT NULL, [privilege_name] [nvarchar](50) NULL, [linked_to] [nvarchar](50) NULL, [sid_id] [bigint] NULL, [username] [nvarchar](128) NULL, [action_type] [nvarchar](20) NOT NULL, [created] [datetime2](7) NOT NULL, [created_by] [nvarchar](128) NOT NULL, [created_by_sid_id] [bigint] NOT NULL, [valid_from] [datetime2](7) NULL, [valid_until] [datetime2](7) NULL, [notes] [nvarchar](1000) NULL, [app_reference] [nvarchar](1000) NULL, CONSTRAINT [PK_user_privilege_log] PRIMARY KEY CLUSTERED ( [primary_key] 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 SET IDENTITY_INSERT [user_restr].[user_privilege_log] ON INSERT [user_restr].[user_privilege_log] ([primary_key], [privilege_type], [privilege_name], [linked_to], [sid_id], [username], [action_type], [created], [created_by], [created_by_sid_id], [valid_from], [valid_until], [notes], [app_reference]) VALUES (1, N'Duty Function to User Link', N'Operations Director', NULL, 3, N'michael.patel', N'Grant', CAST(N'2026-10-10T13:52:17.7529091' AS DateTime2), N'DEMO\svc_demo', 1, NULL, NULL, N'Linked by metadata upload', NULL) INSERT [user_restr].[user_privilege_log] ([primary_key], [privilege_type], [privilege_name], [linked_to], [sid_id], [username], [action_type], [created], [created_by], [created_by_sid_id], [valid_from], [valid_until], [notes], [app_reference]) VALUES (2, N'Duty Function to User Link', N'Managing Director', NULL, 4, N'sarah.chen', N'Grant', CAST(N'2026-10-10T13:52:17.7640186' AS DateTime2), N'DEMO\svc_demo', 1, NULL, NULL, N'Linked by metadata upload', NULL) INSERT [user_restr].[user_privilege_log] ([primary_key], [privilege_type], [privilege_name], [linked_to], [sid_id], [username], [action_type], [created], [created_by], [created_by_sid_id], [valid_from], [valid_until], [notes], [app_reference]) VALUES (3, N'Duty Function to User Link', N'Production Manager', NULL, 5, N'david.robertson', N'Grant', CAST(N'2026-10-10T13:52:17.7721783' AS DateTime2), N'DEMO\svc_demo', 1, NULL, NULL, N'Linked by metadata upload', NULL) INSERT [user_restr].[user_privilege_log] ([primary_key], [privilege_type], [privilege_name], [linked_to], [sid_id], [username], [action_type], [created], [created_by], [created_by_sid_id], [valid_from], [valid_until], [notes], [app_reference]) VALUES (4, N'Duty Function to User Link', N'QA Manager', NULL, 6, N'dr..jennifer.walsh', N'Grant', CAST(N'2026-10-10T13:52:17.7827247' AS DateTime2), N'DEMO\svc_demo', 1, NULL, NULL, N'Linked by metadata upload', NULL) INSERT [user_restr].[user_privilege_log] ([primary_key], [privilege_type], [privilege_name], [linked_to], [sid_id], [username], [action_type], [created], [created_by], [created_by_sid_id], [valid_from], [valid_until], [notes], [app_reference]) VALUES (5, N'Duty Function to User Link', N'Marketing Coordinator', NULL, 7, N'jessica.martinez', N'Grant', CAST(N'2026-10-10T13:52:17.7912527' AS DateTime2), N'DEMO\svc_demo', 1, NULL, NULL, N'Linked by metadata upload', NULL) INSERT [user_restr].[user_privilege_log] ([primary_key], [privilege_type], [privilege_name], [linked_to], [sid_id], [username], [action_type], [created], [created_by], [created_by_sid_id], [valid_from], [valid_until], [notes], [app_reference]) VALUES (6, N'Duty Function to User Link', N'Sales Manager', NULL, 8, N'daniel.o''brien', N'Grant', CAST(N'2026-10-10T13:52:17.7996538' AS DateTime2), N'DEMO\svc_demo', 1, NULL, NULL, N'Linked by metadata upload', NULL) INSERT [user_restr].[user_privilege_log] ([primary_key], [privilege_type], [privilege_name], [linked_to], [sid_id], [username], [action_type], [created], [created_by], [created_by_sid_id], [valid_from], [valid_until], [notes], [app_reference]) VALUES (7, N'Duty Function to User Link', N'Maintenance Manager', NULL, 9, N'frank.mitchell', N'Grant', CAST(N'2026-10-10T13:52:17.8073712' AS DateTime2), N'DEMO\svc_demo', 1, NULL, NULL, N'Linked by metadata upload', NULL) INSERT [user_restr].[user_privilege_log] ([primary_key], [privilege_type], [privilege_name], [linked_to], [sid_id], [username], [action_type], [created], [created_by], [created_by_sid_id], [valid_from], [valid_until], [notes], [app_reference]) VALUES (8, N'Duty Function to User Link', N'WHS Manager', NULL, 10, N'patricia.collins', N'Grant', CAST(N'2026-10-10T13:52:17.8178181' AS DateTime2), N'DEMO\svc_demo', 1, NULL, NULL, N'Linked by metadata upload', NULL) INSERT [user_restr].[user_privilege_log] ([primary_key], [privilege_type], [privilege_name], [linked_to], [sid_id], [username], [action_type], [created], [created_by], [created_by_sid_id], [valid_from], [valid_until], [notes], [app_reference]) VALUES (9, N'Duty Function to User Link', N'Compliance Officer', NULL, 11, N'margaret.hughes', N'Grant', CAST(N'2026-10-10T13:52:17.8278417' AS DateTime2), N'DEMO\svc_demo', 1, NULL, NULL, N'Linked by metadata upload', NULL) INSERT [user_restr].[user_privilege_log] ([primary_key], [privilege_type], [privilege_name], [linked_to], [sid_id], [username], [action_type], [created], [created_by], [created_by_sid_id], [valid_from], [valid_until], [notes], [app_reference]) VALUES (10, N'Duty Function to User Link', N'HR Manager', NULL, 12, N'amanda.foster', N'Grant', CAST(N'2026-10-10T13:52:17.8358744' AS DateTime2), N'DEMO\svc_demo', 1, NULL, NULL, N'Linked by metadata upload', NULL) INSERT [user_restr].[user_privilege_log] ([primary_key], [privilege_type], [privilege_name], [linked_to], [sid_id], [username], [action_type], [created], [created_by], [created_by_sid_id], [valid_from], [valid_until], [notes], [app_reference]) VALUES (11, N'Duty Function to User Link', N'WHS Officer', NULL, 13, N'mark.thompson', N'Grant', CAST(N'2026-10-10T13:52:17.8468803' AS DateTime2), N'DEMO\svc_demo', 1, NULL, NULL, N'Linked by metadata upload', NULL) INSERT [user_restr].[user_privilege_log] ([primary_key], [privilege_type], [privilege_name], [linked_to], [sid_id], [username], [action_type], [created], [created_by], [created_by_sid_id], [valid_from], [valid_until], [notes], [app_reference]) VALUES (12, N'Duty Function to User Link', N'Food Safety Coordinator', NULL, 14, N'thomas.murphy', N'Grant', CAST(N'2026-10-10T13:52:17.8564337' AS DateTime2), N'DEMO\svc_demo', 1, NULL, NULL, N'Linked by metadata upload', NULL) INSERT [user_restr].[user_privilege_log] ([primary_key], [privilege_type], [privilege_name], [linked_to], [sid_id], [username], [action_type], [created], [created_by], [created_by_sid_id], [valid_from], [valid_until], [notes], [app_reference]) VALUES (13, N'Duty Function to User Link', N'Production Supervisor', NULL, 15, N'kevin.brown', N'Grant', CAST(N'2026-10-10T13:52:17.8650127' AS DateTime2), N'DEMO\svc_demo', 1, NULL, NULL, N'Linked by metadata upload', NULL) INSERT [user_restr].[user_privilege_log] ([primary_key], [privilege_type], [privilege_name], [linked_to], [sid_id], [username], [action_type], [created], [created_by], [created_by_sid_id], [valid_from], [valid_until], [notes], [app_reference]) VALUES (14, N'Duty Function to User Link', N'QA Technician', NULL, 16, N'lisa.nguyen', N'Grant', CAST(N'2026-10-10T13:52:17.8729661' AS DateTime2), N'DEMO\svc_demo', 1, NULL, NULL, N'Linked by metadata upload', NULL) INSERT [user_restr].[user_privilege_log] ([primary_key], [privilege_type], [privilege_name], [linked_to], [sid_id], [username], [action_type], [created], [created_by], [created_by_sid_id], [valid_from], [valid_until], [notes], [app_reference]) VALUES (15, N'Duty Function to User Link', N'HR Coordinator', NULL, 17, N'sophie.taylor', N'Grant', CAST(N'2026-10-10T13:52:17.8816922' AS DateTime2), N'DEMO\svc_demo', 1, NULL, NULL, N'Linked by metadata upload', NULL) INSERT [user_restr].[user_privilege_log] ([primary_key], [privilege_type], [privilege_name], [linked_to], [sid_id], [username], [action_type], [created], [created_by], [created_by_sid_id], [valid_from], [valid_until], [notes], [app_reference]) VALUES (16, N'Duty Function to User Link', N'Production Supervisor', NULL, 18, N'rachel.stevens', N'Grant', CAST(N'2026-10-10T13:52:17.8897038' AS DateTime2), N'DEMO\svc_demo', 1, NULL, NULL, N'Linked by metadata upload', NULL) INSERT [user_restr].[user_privilege_log] ([primary_key], [privilege_type], [privilege_name], [linked_to], [sid_id], [username], [action_type], [created], [created_by], [created_by_sid_id], [valid_from], [valid_until], [notes], [app_reference]) VALUES (17, N'Duty Function to User Link', N'Product Development Manager', NULL, 19, N'dr..laura.bennett', N'Grant', CAST(N'2026-10-10T13:52:17.8998095' AS DateTime2), N'DEMO\svc_demo', 1, NULL, NULL, N'Linked by metadata upload', NULL) INSERT [user_restr].[user_privilege_log] ([primary_key], [privilege_type], [privilege_name], [linked_to], [sid_id], [username], [action_type], [created], [created_by], [created_by_sid_id], [valid_from], [valid_until], [notes], [app_reference]) VALUES (18, N'Duty Function to User Link', N'Supply Chain Manager', NULL, 20, N'robert.zhang', N'Grant', CAST(N'2026-10-10T13:52:17.9078230' AS DateTime2), N'DEMO\svc_demo', 1, NULL, NULL, N'Linked by metadata upload', NULL) SET IDENTITY_INSERT [user_restr].[user_privilege_log] OFF GO ALTER TABLE [user_restr].[user_privilege_log] ADD CONSTRAINT [DF_user_privilege_log_created] DEFAULT (sysdatetime()) FOR [created] GO ALTER TABLE [user_restr].[user_privilege_log] ADD CONSTRAINT [DF_user_privilege_log_created_by] DEFAULT (original_login()) FOR [created_by] GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'This table stores records of user privilege changes. Also see user_restr.authoriser_privilege_requests. COPYRIGHT NOTICE This database schema, stored procedures and functions are protected by copyright. Copyright. Silkwood Software Pty. Ltd. 2026' , @level0type=N'SCHEMA',@level0name=N'user_restr', @level1type=N'TABLE',@level1name=N'user_privilege_log' GO