The Overloaded Time Table
by Mark Bowytz
in Feature Articles
on 2012-11-15
A few years ago, while on a SQL Server data warehousing project, my project manager sent me a request - create a table with all kinds of information based on a given date. You know – given a date, be able to figure out day of the year, day of the week, month, last business day of the week, and so on, making sure the table stores enough dates to keep it maintenance free. Oh, and one more thing, it’s going to be linked off of the already complex star schema that we were developing for. Why? For reporting purposes of course.
Thankfully, I was able to talk my way out of it by explaining how SQL Server has built-in date functions that can do the job on the fly and that if I were to make that table, I’d have to go through the trouble of writing a bunch of date-related code anyway. However, the original developer for the database that Terje Nilima Monsen works on, must not have been as lucky as I was.