Closed DaveDustin closed 1 year ago
In JobRunner.AddAgentJob the msdb.dbo.sp_add_jobstep assigns the @database_name value to the target database for the job.
If this job were running on a secondary node where the Readable-Secondary configuration is set to Read-Only instead of All the job will fail because it cannot connect to the database to execute the step.
Fixed. Thanks for pointing this out.
In JobRunner.AddAgentJob the msdb.dbo.sp_add_jobstep assigns the @database_name value to the target database for the job.
If this job were running on a secondary node where the Readable-Secondary configuration is set to Read-Only instead of All the job will fail because it cannot connect to the database to execute the step.