Skip to content

Enhance JobCursor declaration to filter job steps by database name#994

Open
junuaidm wants to merge 1 commit intoolahallengren:mainfrom
junuaidm:bug/fix-sp-verify-jobstep
Open

Enhance JobCursor declaration to filter job steps by database name#994
junuaidm wants to merge 1 commit intoolahallengren:mainfrom
junuaidm:bug/fix-sp-verify-jobstep

Conversation

@junuaidm
Copy link
Copy Markdown

@junuaidm junuaidm commented Mar 6, 2026

#993

Root cause: The last block of the updated Hallengren SQLServerMaintenance.sql script (lines 9487–9514) runs unconditionally — it is not guarded by the @CreateJobs = 'N' check. This block cursors through msdb.dbo.sysjobsteps looking for existing job steps that use the old @Checksum casing, and calls sp_update_jobstep to fix them to @Checksum.
When sp_update_jobstep is called, SQL Server Agent internally calls sp_verify_jobstep, which re-validates the database_name field of the existing job step. Orphaned SQL Agent job steps from a previous deployment test still reference

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant