Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Holidays Expand / Collapse
Author
Message
Posted Tuesday, May 26, 2009 1:27 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Tuesday, May 18, 2010 10:53 AM
Points: 17, Visits: 86
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?
Post #723554
Posted Tuesday, May 26, 2009 1:38 PM


SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Saturday, April 12, 2014 3:14 AM
Points: 491, Visits: 832
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.

Post #723569
Posted Tuesday, May 26, 2009 1:41 PM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Monday, February 17, 2014 8:01 AM
Points: 1,682, Visits: 446
Hi,

Go to maintenance plan >>>edit>> Skip sat and sun for weekends.

On a perticular holiday skip perticular day




- Pradyothana


http://www.msqlserver.com
Post #723572
Posted Tuesday, May 26, 2009 1:42 PM


SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Tuesday, March 18, 2014 12:13 PM
Points: 195, Visits: 1,080
Type in Holiday Table in the upper right Search area on this page, and hit Go. You would get a lot hits.
Post #723573
Posted Tuesday, May 26, 2009 1:45 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Tuesday, May 18, 2010 10:53 AM
Points: 17, Visits: 86
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!
Post #723575
Posted Tuesday, May 26, 2009 2:07 PM


SSCoach

SSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoach

Group: General Forum Members
Last Login: Monday, April 14, 2014 1:34 PM
Points: 15,442, Visits: 9,588
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
Post #723595
Posted Tuesday, May 26, 2009 3:37 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Tuesday, May 18, 2010 10:53 AM
Points: 17, Visits: 86
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 .
Post #723653
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse