Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin.
Search for scripts directly from SSMS, and instantly access any saved scripts in your
SSC briefcase from the favorites tab.
Download now (direct download link)
Thank this author by sharing:
By Joshua A. Walker,
These are functions related to the date and time dimensions created by the script posted here:http://www.sqlservercentral.com/scripts/TSQL/65762/
There are three functions. Copy them and run them in the same place where you have your dim_Date and dim_Time dimension tables.
There are example calls for each function in the comments section of each function.
SELECT dbo.WHSE_fnGetDateKey(getdate()) [DATEID], dbo.WHSE_fnGetTimeKey(getdate()) [TIMEID]
This is a vital piece for quickly and easily converting your datetime strings into the IDs for the date and time dimensions prior to storage in your fact tables.
Advantages of Time Dimension
Here is a simple script that I use to create a Date Dimension table.
Bill explains what is meant by a 'Member' and 'Member function' in MDX. A member is an item in a di...
How to Convert nx1 dimension table to 1x1 dimension table