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 2008 Forums
 Transact-SQL (2008)
 If Sql Job Fails Scheduler should not execute

Author  Topic 

kond.mohan
Posting Yak Master

213 Posts

Posted - 2013-10-14 : 00:58:04
Hi
I have Created Sql job for Loading the data from source(oracle) to destination(sql server 2008)using SQL Agent.due to Various reasons job getting Failed.different Scheduled Reports and other jobs are using these data(Tables).if job gets fail My scheduler reports,jobs..(scheduled ones,sps...) should not work. otherwise scheduler needs to function normally.



visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-10-14 : 01:52:59
add a check as the first step of other jobs to see if destination table has tbe required data. do other steps only if it has data otherwise exit the jobs.

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

kond.mohan
Posting Yak Master

213 Posts

Posted - 2013-10-14 : 02:56:52
hi visakh,

thx for your comments.

if suppose i will give the condition select count(*) from table>0 then go the next step in this case job failed but table has been loaded in the destination table Partially. and select count(*) from table>0 condition Succeded.job executed but report has been generated incorrectly.how to make in those specifed cases.

Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-10-14 : 05:26:27
do you've a control table where you capture job execution status?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

kond.mohan
Posting Yak Master

213 Posts

Posted - 2013-10-14 : 09:49:24
i have created table.if table success insert value into table kind of way using ssis pkg .else failed string insert into the table.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-10-14 : 09:51:36
quote:
Originally posted by kond.mohan

i have created table.if table success insert value into table kind of way using ssis pkg .else failed string insert into the table.


then you can check the contents of above table and determine whether to execute next steps or not

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
   

- Advertisement -