如何使SQL代理作业忽略警告? [英] How can I make a SQL agent job to ignore warnings?
问题描述
嗨!各位,
我有一个SQL代理作业失败,因为它运行时会收到10个警告
一个存储过程。这些警告是微不足道的,可以忽略不计。可以
我让它忽略这些警告并继续吗?我认为有一些
设置可以改变代理人工作的默认行为
有关警告,但我只是不知道该怎么做。
有什么想法吗?
谢谢,
加里
Hi! guys,
I have a SQL agent job fails because it gets 10 warnings when it runs
a stored procedure. These warnings are trivial and can be ignored. Can
I make it ignore these warnings and proceed? I think there is some
setting I can do to change the default behavour of an agent job
regarding warnings but I just don''t know how to do it.
Any idea?
Thanks,
Gary
推荐答案
Gary(ro************@yahoo.com.au)写道:
Gary (ro************@yahoo.com.au) writes:
我有一个SQL代理工作失败,因为它在运行存储过程时会收到10个警告。这些警告是微不足道的,可以忽略不计。可以
我让它忽略这些警告并继续吗?我认为我可以做一些设置来改变代理人工作的默认行为
关于警告,但我只是不知道该怎么做。
I have a SQL agent job fails because it gets 10 warnings when it runs
a stored procedure. These warnings are trivial and can be ignored. Can
I make it ignore these warnings and proceed? I think there is some
setting I can do to change the default behavour of an agent job
regarding warnings but I just don''t know how to do it.
你到底发生了什么警告?
-
Erland Sommarskog,SQL Server MVP, es **** @ sommarskog.se
SQL Server SP3的联机书籍
http://www.microsoft.com/sql/techinf...2000/books .asp
Erland Sommarskog< es **** @ sommarskog.se>在消息新闻中写道:< Xn ********************* @ 127.0.0.1> ...
Erland Sommarskog <es****@sommarskog.se> wrote in message news:<Xn*********************@127.0.0.1>...
Gary(ro * ***********@yahoo.com.au)写道:
Gary (ro************@yahoo.com.au) writes:
我有一个SQL代理作业失败,因为它运行时会收到10个警告
存储过程。这些警告是微不足道的,可以忽略不计。可以
我让它忽略这些警告并继续吗?我认为我可以做一些设置来改变代理人工作的默认行为
关于警告,但我只是不知道该怎么做。
I have a SQL agent job fails because it gets 10 warnings when it runs
a stored procedure. These warnings are trivial and can be ignored. Can
I make it ignore these warnings and proceed? I think there is some
setting I can do to change the default behavour of an agent job
regarding warnings but I just don''t know how to do it.
<你有什么警告吗?
Exactly what warnings do you get?
Erland,
感谢您的回复。
我认为它是警告8153.类似于NULL值已被
通过聚合函数或SET语句消除 (不完全是
字)。这份工作属于我们的供应商之一。基本上
是它调用的一个存储过程中的一个错误。有问题的存储过程中的一个SET
语句没有使用isnull()
函数来正确过滤子查询的结果。
>
虽然我可以修改存储过程以使用isnull()或句柄
代码中的警告,我不应该更改他们的代码
(当然我和他们一起记录支持电话)。事情是我不能等待
的回复,与此同时,我也不想设置ANSI_WARNINGS
OFF。
这就是我提出原始问题的原因。对我来说,有趣的是我们是否可以在
服务器/数据库级别上执行某些操作来优化代理作业的行为
与错误处理或错误容忍相关。
任何想法?
干杯,
Gary
Erland,
Thanks for your reply.
I think it is warning 8153. Something like "NULL value has been
eliminated by aggregate function or by a SET statement" (not exact
words though). The job belongs to one of our vendors. Basically there
is a bug in one of the stored procedures it calls. One of SET
statements in the problematic stored procedure doesn''t use isnull()
function to filter the result of a subquery properly.
Although I can modify the stored procedure to use isnull() or handle
the warnings within the code, I am not supposed to change their code
(of course I log a support call with them). The thing is I can''t wait
for the response, in the meantime, I don''t want to set ANSI_WARNINGS
OFF either.
That is the reason I raised my original question. It is also
interesting to me that whether we can do something on the
server/database level to refine the behavour of a agent job in
relation to error handling, or error tolerance rather.
Any idea?
Cheers,
Gary
Gary(ro************@yahoo.com.au)写道:
Gary (ro************@yahoo.com.au) writes:
我认为这是警告8153.类似NULL值已经被聚合函数或SET语句消除了。 (不完全是
的话)。这份工作属于我们的供应商之一。基本上
是它调用的一个存储过程中的一个错误。有问题的存储过程中的一个SET
语句没有使用isnull()
函数来正确过滤子查询的结果。
虽然我可以修改存储过程使用isnull()或处理代码中的警告,我不应该更改他们的代码
(当然我记录了他们的支持电话)。事情是我不能等待
回复,同时,我也不想设置ANSI_WARNINGS
OFF。
这就是我的原因提出了我原来的问题。我也很感兴趣,我们是否可以在服务器/数据库级别上做一些事情来改进与错误处理或错误容忍相关的代理作业的行为。
I think it is warning 8153. Something like "NULL value has been
eliminated by aggregate function or by a SET statement" (not exact
words though). The job belongs to one of our vendors. Basically there
is a bug in one of the stored procedures it calls. One of SET
statements in the problematic stored procedure doesn''t use isnull()
function to filter the result of a subquery properly.
Although I can modify the stored procedure to use isnull() or handle
the warnings within the code, I am not supposed to change their code
(of course I log a support call with them). The thing is I can''t wait
for the response, in the meantime, I don''t want to set ANSI_WARNINGS
OFF either.
That is the reason I raised my original question. It is also
interesting to me that whether we can do something on the
server/database level to refine the behavour of a agent job in
relation to error handling, or error tolerance rather.
我必须承认我精通Agent的错综复杂,因为我只是偶尔使用
。但我跑了两步,第一步包括
一些SELECT avg(col)FROM tbl其中col是一个具有许多
NULL值的列,第二步只是一个PRINT语句。我跑了这个
的工作,代理人说这是成功的。当然,在工作历史中有一些输出
,但这不是失败。
一种可能性是你的步骤中也存在真正的错误。
如果你在Agent中查找工作,双击它并转到步骤,
然后编辑,有高级选项卡。在这里你可以控制成功和失败时会发生什么。你也可以直接输出
到一个文件。
-
Erland Sommarskog,SQL Server MVP, es **** @ sommarskog.se
SQL Server SP3联机丛书
http://www.microsoft.com/sql/ techinf ... 2000 / books.asp
这篇关于如何使SQL代理作业忽略警告?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!