Sadly there is no standard function in SQL Server to check whether a date is a public holiday. To find out, it helps to use a date dimension as explained here.

Then you can easily see whether a day is a public holiday:

SQL
SELECT *
FROM dbo.DimDatum
WHERE IsFeestDag_NL = 1

All public holidays in 2012:

Public holidays in SQL

In the same way you can get the day name in Dutch for a date:

Day names in SQL

Frequently asked questions

Does SQL Server have a function to check whether a date is a public holiday?

No. SQL Server has no standard function for public holidays. Use a date dimension with a column that tells you whether the day is a public holiday.

How do I get all Dutch public holidays from a date dimension?

Select the rows from the date dimension where IsFeestDag_NL equals 1. For example: SELECT * FROM dbo.DimDatum WHERE IsFeestDag_NL = 1.

How do I get the Dutch day name of a date in SQL Server?

Get the day name from the date dimension. It holds the day name in Dutch for each date, the same way as the public holidays.

Which column in the date dimension marks a public holiday?

The column IsFeestDag_NL in the table dbo.DimDatum. The value 1 means the date is a Dutch public holiday.

How do I show all public holidays of one year in SQL Server?

Filter the date dimension on IsFeestDag_NL = 1 and on the year you want. That way you get, for example, all public holidays of 2012.

Comments

Your email address is not shown. A photo comes from Gravatar, if you have one.