SDU Tools: Calculate Date Dimension columns in SQL Server T-SQL

When you're building a data warehouse using SQL Server, one of the first things that most people start to design is a Date dimension. To make that really, really easy, inĀ our free SDU Tools for developers and DBAs, we added a tool called DateDimensionColumns.

This tool is a table-valued function that takes a date, and returns a set of columns that many will find enough for a good Date dimension. You can see the list of returned columns in the main image above.

Range of Dates

If you then combine it with our DatesBetween tool that returns a set of dates between a start and end date, by using CROSS APPLY, you have a nearly complete solution for creating a date dimension.

And that's exactly what another of our tools GetDateDimension does!

Find out more

You can see it in action in the main image above, and see both tools in the video here:

You can see GetDateDimension here:

Access to SDU Tools is one of the benefits of being an SDU Insider, along with access to our other free tools and eBooks. Please just visit here for more info:

http://sdutools.sqldownunder.com

 

Leave a Reply

Your email address will not be published. Required fields are marked *