Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Holidays


Holidays

Author
Message
Joshua Austill-492084
Joshua Austill-492084
Grasshopper
Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)

Group: General Forum Members
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?
Andy Hogg
Andy Hogg
Mr or Mrs. 500
Mr or Mrs. 500 (582 reputation)Mr or Mrs. 500 (582 reputation)Mr or Mrs. 500 (582 reputation)Mr or Mrs. 500 (582 reputation)Mr or Mrs. 500 (582 reputation)Mr or Mrs. 500 (582 reputation)Mr or Mrs. 500 (582 reputation)Mr or Mrs. 500 (582 reputation)

Group: General Forum Members
Points: 582 Visits: 1011
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.
Pradyothana Shastry
Pradyothana Shastry
SSCommitted
SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)

Group: General Forum Members
Points: 1702 Visits: 481
Hi,

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

On a perticular holiday skip perticular day


- Pradyothana


http://www.msqlserver.com
DBA in Unit 7
DBA in Unit 7
SSC Veteran
SSC Veteran (203 reputation)SSC Veteran (203 reputation)SSC Veteran (203 reputation)SSC Veteran (203 reputation)SSC Veteran (203 reputation)SSC Veteran (203 reputation)SSC Veteran (203 reputation)SSC Veteran (203 reputation)

Group: General Forum Members
Points: 203 Visits: 1124
Type in Holiday Table in the upper right Search area on this page, and hit Go. You would get a lot hits.
Joshua Austill-492084
Joshua Austill-492084
Grasshopper
Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)

Group: General Forum Members
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!
GSquared
GSquared
SSChampion
SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)

Group: General Forum Members
Points: 14385 Visits: 9729
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
Joshua Austill-492084
Joshua Austill-492084
Grasshopper
Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)

Group: General Forum Members
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 :-D.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search