SET QUOTED_IDENTIFIER ON;

GO

----------
EXEC SEC.UpsertProcedureAndSetToProfile 'MMS.GetLastWorkOrderCloseTimestampByTemplate', 'admin Profile', 'devops';
EXEC SEC.UpsertProcedureAndSetToProfile 'MMS.CreateWorkOrderFromCronTemplate', 'admin Profile', 'devops';
EXEC SEC.UpsertProcedureAndSetToProfile 'MMS.GetDefaultTemplate', 'admin Profile', 'devops';
EXEC SEC.UpsertProcedureAndSetToProfile 'MMS.GetTemplateAttachments', 'admin Profile', 'devops';
EXEC SEC.UpsertProcedureAndSetToProfile 'MMS.GetTemplateResources', 'admin Profile', 'devops';
EXEC SEC.UpsertProcedureAndSetToProfile 'MMS.GetTemplates', 'admin Profile', 'devops';
EXEC SEC.UpsertProcedureAndSetToProfile 'MMS.GetTemplatesWithCronExpression', 'admin Profile', 'devops';
EXEC SEC.UpsertProcedureAndSetToProfile 'MMS.LinkTemplateAttachments', 'admin Profile', 'devops';
EXEC SEC.UpsertProcedureAndSetToProfile 'MMS.UnlinkTemplateAttachments', 'admin Profile', 'devops';
EXEC SEC.UpsertProcedureAndSetToProfile 'MMS.UpsertTemplate', 'admin Profile', 'devops';

 EXEC [SYSTEM].[UpsertJob]
 @JobId = NULL,
 @sProcedure = 'MMS.SchedulerJob',
 @StartTime = '2025-12-04 05:00:00',
 @PeriodTime = 3600,
 @RestartAfterFailure = 1,
 @User = 'admin'


