May 5, 2006 at 9:04 am
I am looking for a mechanism that I can imbed in a T-SQL script that will cause a job to fail thus kicking off the 'on failure' notifications. In essence, I want to do a Select Count(*) and if the count is zero, have the job fail. Any suggestions?
May 5, 2006 at 9:06 am
i think any error raised with a level above 16 would fail, so in any script, you could simply add this line:
RAISERROR ('Testing to see if a job fails for raised errors', 16, 1)
if select count(*) from sometable
RAISERROR ('Testing count of records was zero, aborting procedure', 16, 1)
Lowell
May 5, 2006 at 10:09 am
The RAISERROR worked really slick. Thanks!
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply