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
 General SQL Server Forums
 New to SQL Server Programming
 RE: scheduled Jobs

Author  Topic 

kvt.aravind
Starting Member

24 Posts

Posted - 2010-08-24 : 09:46:34
Hi all,

Am using following query in scheduled jobs

Delete from tata_travel_ticketinfo Where tata_travel_ticketinfo.book_id in (select tata_travel_ticketinfo.book_id from tata_travel_ticketinfo inner join tata_travel_bookticketnew on tata_travel_bookticketnew.book_id = tata_travel_ticketinfo.book_id and tata_travel_ticketinfo.Status in ('open') and tata_travel_ticketinfo.created_on < dateadd(dd,-90,getdate()))
go
which will be exceuted automatically once in a month(ie., 2day of every month)and it will delete the records which are beyond 90 days. but if it is doesnot executed next month due to some problems then how can i delete the records

Aravind.T

Lamprey
Master Smack Fu Yak Hacker

4614 Posts

Posted - 2010-08-24 : 11:11:36
I'm not sure I understand your question... But, you could execute the job or the sql manually.
Go to Top of Page

slimt_slimt
Aged Yak Warrior

746 Posts

Posted - 2010-08-24 : 11:24:03
you can track execution of your jobs and see the results of execution. in case of failed job execution, you can still run query manually. ie. 2day of the month.

you can even set some IF statements in case of that.

if SQL Agents is not running i suggest you to go blame the DBA :)
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2010-08-24 : 13:15:18
If it just deletes "everything OPEN which was created more than 90 days ago" why not schedule it to run every night? Then the delete job is small, and if it doesn't run for a few days, even, it won't make much difference.
Go to Top of Page
   

- Advertisement -