September 20, 2005 at 11:35 am
I would like to create a SQL job which runs a select query to watch for certain data flags - can I base the success or failure on the data returned? I know I could do this with DTS/ActiveX, but it seems like there should be a way to do this with a job. Any ideas?
Thanks
Jeff
September 20, 2005 at 11:39 am
Might be sneaky but...
If not exists (Select flag where..)
begin
select 1/0
--should fail, make this step exit the job on failure.
end
else
begin
--don't do anything>> will go to next step
end
or you could actually control the flow from there and call the appropriate sp as needed.
September 20, 2005 at 4:06 pm
See if this can help you
http://www.sqlservercentral.com/forums/shwmessage.aspx?forumid=5&messageid=9576
Regards,Yelena Varsha
September 21, 2005 at 10:14 am
Thanks folks - I ended up going with RAISERROR (duh....forgot about it) but I love the select 1/0 answer!! Very clever.
September 21, 2005 at 11:37 am
Thanx .
HTH.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply