INSERT INTO [VCLib].[T_JOB] ([JobID], [Name], [ConcurrentExecute], [JobUser])
VALUES ('92E370C2-C25D-4AF7-9FB4-7749D24159B0', 'Удаление IHE_CLINICALDOCUMENT_EVENT старше 30 дней', 0, NULL);
GO

INSERT INTO [VCLib].[T_JOB_SCHEDULE] ([ScheduleID], [Job], [Mask], [StartDate], [EndDate], [Recurs], [StartTime], [Enabled], [Type], [Occurs], [Servers])
VALUES('BF348047-29C4-4E14-B1C1-D2E46A9D0B78', '92E370C2-C25D-4AF7-9FB4-7749D24159B0', NULL, CONVERT(DATETIME, '2025-02-19 00:00:00.000', 121), NULL, 1, CONVERT(DATETIME, '2007-05-17 01:00:00.000', 121), 1, 2, 0, NULL)
GO

INSERT INTO [VCLib].[T_SCHEDULER_OPERATION] ([OperationID], [Name], [type_], [ProcessName])
VALUES('5E8D9387-1054-44E5-9AF3-755488DD4CDD', 'Удаление IHE_CLINICALDOCUMENT_EVENT старше 30 дней', (SELECT TOP 1 ENTITYID FROM VCLib.T_ENTITIES WHERE EntName = 'RUN_PROCESS_OPERATION'), 'DropExpiredIheClinicalDocumentEvent');
GO

INSERT INTO [VCLib].[T_JOB_STEP] ([JobStepID], [Step], [ContinueOnError], [Job], [Operation])
VALUES('026B102A-B03C-440E-871C-51187837AB41', 1, 0, '92E370C2-C25D-4AF7-9FB4-7749D24159B0', '5E8D9387-1054-44E5-9AF3-755488DD4CDD')
GO

INSERT INTO [VCLIB].[T_PROCESS_HANDLER_CUSTOM] ([CustomProcessHandlerID], [ProcessName], [ObjectName], [PrepareLexem], [ExecuteLexem], [PostExecuteLexem])
VALUES ('ED8F562E-3CAB-4204-9EB9-B9BA868A0551', 'DropExpiredIheClinicalDocumentEvent', null, 'begin(sp_params, gnp)          @gnp := new Process("StoredProcedureProcess");          @gnp->{Parameters}["ParamSPName"] := "akuz.sp_dropexpirediheclinicaldocumentevent";          @gnp->Run();  end', null, null)
GO
