“指定的‘@notify_email_operator_name’无效”错误
我有一个脚本化的 SQL Server 代理作业,我试图从服务器传输到本地数据库,但收到此错误消息:
Msg 14234,Level 16,State 1,Procedure sp_verify_job,Line 243 指定的“@notify_email_operator_name”无效(有效值由 sp_help_operator 返回)。
双击错误消息甚至不会将我带到失败的行。以前有其他人得到过这个吗?
I have a scripted SQL Server Agent job I'm trying to transfer over to my local database from a server, but I receive this error message:
Msg 14234, Level 16, State 1, Procedure sp_verify_job, Line 243
The specified '@notify_email_operator_name' is invalid (valid values are returned by sp_help_operator).
Double clicking the error message won't even take me to the line that it fails on. Has anybody else gotten this before?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
使用
Ctrl+F
查找@notify_email_operator_name
出现的位置。它可能设置为您尚未在本地计算机上设置的电子邮件配置文件。
对于 SQL Server 2005 及更高版本,您可以使用 SMTP 服务器设置数据库邮件。
就您而言,您可能只是在计算机上进行一些测试,并且您可能不关心电子邮件通知,因此您可以安全地设置
@notify_email_operator_name = NULL
,然后重新运行脚本。Use
Ctrl+F
to find where@notify_email_operator_name
appears.It probably is set to an email profile that you haven't set up on your local machine.
For SQL Server 2005 and above, then you can set up database mail using an SMTP server.
In your case, you might just be doing some testing on your machine, and you might not care about the email notifications so you can safely set
@notify_email_operator_name = NULL
and then re-run the script.在 SSMS 左侧的 SQL Server 代理树下,您将找到一个名为操作员的节点。创建一个与您缺少的名称相同的脚本,或者从生成作业创建脚本的同一位置生成一个创建脚本。
Under your SQL Server Agent Tree on the left hand side of SSMS you'll find a node called operators. Create one with the same name as what your missing, or generate a create script from the same place as you generated your job create script.
您的服务器可能有一个操作员设置用于发送您没有的电子邮件通知。如果您确实需要电子邮件通知,或者您只想匹配服务器环境以进行测试,请在填写空白后运行以下命令:
Your server probably has an operator set up for email notifications that you don't have. If you do want e-mail notifications, or if you just want to match your server's environment for testing purposes, run the following after filling in the blanks:
我在部署/升级本地测试数据库时遇到了这个问题,我花了整个下午的时间来弄清楚如何解决这个问题,即使我们有三个答案作为线索。
Davos 的答案应该是正确的,但就我而言,我通过
@notify_email_operator_name
找到的sp_add_job
已分配了默认值,因此我不能将其更改为 null。因此,谈到 Tod 的答案,我添加了一个名为
notify_email_operator_name
的操作员,但它不起作用,并且部署显示相同的错误。然后我认为如果部署在生产服务器上工作,就必须有正确的操作员。所以我连接到生产服务器,发现操作员的正确名称实际上是分配的默认值。
解决方案简述
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