Job Schedule Owner Id bulk update to match job owner

UPDATE msdb.dbo.sysschedules SET msdb.dbo.sysschedules.owner_sid=job.owner_sid
FROM msdb.dbo.sysjobs job (NOLOCK)
inner join msdb.dbo.sysjobschedules jobsch (NOLOCK)on job.job_id = jobsch.job_id
INNER JOIN msdb.dbo.sysschedules sch (NOLOCK)on sch.schedule_id = jobsch.schedule_id

Leave a Reply

Your email address will not be published. Required fields are marked *