Alex Rivera | Logout

How do I determine a public holiday in Sql server?

Asked 2009-01-19T10:34:07.467
20

I have an application written in c# that cannot run on a public holiday or a weekend. I've looked around a bit and haven't found anywhere (official) that provides all the public holidays for the next say 50 years.

If I can get these, I will simply bulk insert them into my sql server Holidays table and use that. However, I can't find this data anywhere.

Does anyone know if Sql server has any support for public holidays or an algorithm of some sort to work them out? Or does anyone have somewhere official that I can bulk insert from.

Edit
Report

3 Answers

8

As far as I know there isn't any 'official' source, and this is indeed highly dependent on locale. You'd have to manage these manually. A good source seems to be:

http://en.wikipedia.org/wiki/List_of_holidays_by_country

Even under these circumstances it's very tricky to manage. For example, I live in Belgium, and different parts of the country have different holidays. Government workers for example have different holidays compared to the rest of the workforce, and this is in the same locale code.

answered 2009-01-19T10:39:59.890
2

Ahhh, holiday calendars. The bane of any investment bank programmer's life. There's no way of doing it other than maintaining your own list, I'm afraid!

answered 2009-01-19T11:23:27.320
0

In addition to allowing the user to configure what days are holidays, it would be nice if you allowed the user to select a calendar to import or even to subscribe to. iCalShare has a nice list. However, it's probably too much work for a feature that's merely nice.

answered 2009-01-19T11:23:57.633

Your Answer