Hi,
I scheduled to run a SP which uses XP_SMTP_SENDMAIL. I
have both MSSQLSERVER and MS SQL Agent running on system
account. The server is in a different domain and the mail
server is in different domain.
When I run the SP in QA, it runs without any error. But on
scheduling, it gives the following error:
"The Job failed. The job was invoked by User sa. The last
step to run was step 1 (mail task)."
Was it a problem of startup account?
TIA,
HariYou need to check out the output file for the jobstep (and first define such, of course). Here you
can fine the error message created. "It failed" doesn't tell us anything...
--
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
"Hari" <anonymous@.discussions.microsoft.com> wrote in message
news:05c201c39c78$09491960$a601280a@.phx.gbl...
> Hi,
> I scheduled to run a SP which uses XP_SMTP_SENDMAIL. I
> have both MSSQLSERVER and MS SQL Agent running on system
> account. The server is in a different domain and the mail
> server is in different domain.
> When I run the SP in QA, it runs without any error. But on
> scheduling, it gives the following error:
> "The Job failed. The job was invoked by User sa. The last
> step to run was step 1 (mail task)."
> Was it a problem of startup account?
> TIA,
> Hari
>|||Thanks.
I had used RAISERROR inside SP which uses
XP_SMTP_SENDMAIL. When I removed that code, the job
completed successfully.
>--Original Message--
>You need to check out the output file for the jobstep
(and first define such, of course). Here you
>can fine the error message created. "It failed" doesn't
tell us anything...
>--
>Tibor Karaszi, SQL Server MVP
>Archive at: http://groups.google.com/groups?
oi=djq&as_ugroup=microsoft.public.sqlserver
>
>"Hari" <anonymous@.discussions.microsoft.com> wrote in
message
>news:05c201c39c78$09491960$a601280a@.phx.gbl...
>> Hi,
>> I scheduled to run a SP which uses XP_SMTP_SENDMAIL. I
>> have both MSSQLSERVER and MS SQL Agent running on system
>> account. The server is in a different domain and the
mail
>> server is in different domain.
>> When I run the SP in QA, it runs without any error. But
on
>> scheduling, it gives the following error:
>> "The Job failed. The job was invoked by User sa. The
last
>> step to run was step 1 (mail task)."
>> Was it a problem of startup account?
>> TIA,
>> Hari
>>
>
>.
>|||Yes, an error with severity level > 10 makes the job fail. If you only want to write to the
eventlog, you can use xp_logevent.
--
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
"Hari" <anonymous@.discussions.microsoft.com> wrote in message
news:063f01c39c7f$14d81130$a501280a@.phx.gbl...
> Thanks.
> I had used RAISERROR inside SP which uses
> XP_SMTP_SENDMAIL. When I removed that code, the job
> completed successfully.
>
> >--Original Message--
> >You need to check out the output file for the jobstep
> (and first define such, of course). Here you
> >can fine the error message created. "It failed" doesn't
> tell us anything...
> >
> >--
> >Tibor Karaszi, SQL Server MVP
> >Archive at: http://groups.google.com/groups?
> oi=djq&as_ugroup=microsoft.public.sqlserver
> >
> >
> >"Hari" <anonymous@.discussions.microsoft.com> wrote in
> message
> >news:05c201c39c78$09491960$a601280a@.phx.gbl...
> >> Hi,
> >>
> >> I scheduled to run a SP which uses XP_SMTP_SENDMAIL. I
> >> have both MSSQLSERVER and MS SQL Agent running on system
> >> account. The server is in a different domain and the
> mail
> >> server is in different domain.
> >>
> >> When I run the SP in QA, it runs without any error. But
> on
> >> scheduling, it gives the following error:
> >>
> >> "The Job failed. The job was invoked by User sa. The
> last
> >> step to run was step 1 (mail task)."
> >>
> >> Was it a problem of startup account?
> >>
> >> TIA,
> >> Hari
> >>
> >>
> >
> >
> >.
> >