I ran into this while deploy/upgrade my local testing DB and it took me the whole afternoon to figure how to work it out even we have three answers as clues.
Davos's answer should be correct but in my case, the sp_add_job
I found with @notify_email_operator_name
had a default value assigned already so I can't just change it to null.
So it comes to Tod's answer, I add an operator named notify_email_operator_name
but it doesn't work and deployment shows the same error.
Then I think if the deployment works on the production server, there has to have the correct operator. So I connect to the production server and found out the correct name of the operator is actually the assigned default value.
Solution in short
- Go to the MS SQL that deployment works as expected.
- Under SQL Server Agent > Operators > Find the operator you need.
- Right-click > Script Operator as > Create To > ClipBoard.
- Run the script in clipboard on the server that has the issue.
@notify_email_operator_name'
and check which ones you haven't set up on your local instance and adjust as necessary. – Rest