Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 ignore error in SQL job not working..

Author  Topic 

nhuanlieu
Starting Member

27 Posts

Posted - 2009-06-18 : 18:28:00
Hi, I have a SQL 2005 store proc that includes a way (SET XACT_ABORT OFF) to ignore any in-transit errors and keeps the process going. With SET XACT_ABORT OFF, it works as intended when run manually via Query Analyzer, but when I schedules this SP as a job, when it encounters an error, it stop dead where it was instead of keeps going.

Does anyone have any idead how to handle it where I'd get the same result when I not running it as a job? I even tried all 3 options in the "On failure action" on the "Job Step Properties" and has no luck, please advise.

Thanks in advance.

jholovacs
Posting Yak Master

163 Posts

Posted - 2009-06-22 : 09:16:45
Have you tried a TRY...CATCH block? That would be the first thing I would check out.



SELECT TOP 1
w.[name]
FROM
dbo.women w
INNER JOIN
dbo.inlaws i
ON
i.inlaw_id = w.parent_id
WHERE
i.net_worth > 10000000
AND
i.status IN ('dead', 'dying')
AND
w.husband_id IS NULL
ORDER BY
w.hotness_factor DESC
Go to Top of Page
   

- Advertisement -