May 26, 2009 at 1:27 pm
Hello all. I'm having a hard time with something. I have a job that runs Monday through Friday, and goes out to an external database and does a simple import. My problem is that on holidays this external database does not get updated, so I end up with duplicates of every record. This isn't a huge deal as I can just delete half of them based on the auto increment ID field and move on. However, it would be nice if this didn't happen at all. The data I am importing is so simple its hard to programatically know that it's duplicate data. Its basically just a list of account numbers, balances, account types, names, and an Average Balance for the month. From this its not possible to say if the account number is the same it's a duplicate, because the account numbers are always the same, only the balances change.
So, I had the thought that I could populate a simple table called holidays, then have my process check that table against today's date and if there's a match skip the rest of the job. I'm not sure if I'm even going down the right path with my thinking though. Has anyone else had to work through this before?
May 26, 2009 at 1:38 pm
I believe that your thinking with a holiday dates table is spot on Joshua.
Your job could simply determine if today's date is in the table, and if not, could then run another separate job using sp_start_job to perform the actual import.
May 26, 2009 at 1:41 pm
Hi,
Go to maintenance plan >>>edit>> Skip sat and sun for weekends.
On a perticular holiday skip perticular day
May 26, 2009 at 1:42 pm
Type in Holiday Table in the upper right Search area on this page, and hit Go. You would get a lot hits.
May 26, 2009 at 1:45 pm
Andy Hogg (5/26/2009)
I believe that your thinking with a holiday dates table is spot on Joshua.Your job could simply determine if today's date is in the table, and if not, could then run another separate job using sp_start_job to perform the actual import.
Ya, I hadn't even thought of just using sp_start_job, that actually makes this seem like a fairly trivial task. Thanks!
May 26, 2009 at 2:07 pm
Calendar table with holidays in it is definitely the way to go.
The biggest consideration with that is having someone keep the holidays up-to-date, or you end up with a sort of Y2K issue.
You can have it auto-populate the standard ones. But if there are business-specific holidays, or if a new federal holiday is created, there needs to be a well-documented means of handling those. In many companies, HR issues a list of the year's holidays at the end of the prior year, so it can be handled by them, and they can use it to issue the list if you set that up. That works pretty well.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
May 26, 2009 at 3:37 pm
sunny Brook (5/26/2009)
Type in Holiday Table in the upper right Search area on this page, and hit Go. You would get a lot hits.
Thanks, amazing that adding table to holiday gives such better results :-D.
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply