Click here to Skip to main content
15,883,814 members
Articles / Database Development / SQL Server

Creating Time Dimension in Microsoft Analysis Services

Rate me:
Please Sign up or sign in to vote.
4.75/5 (12 votes)
6 May 2008CPOL 92.6K   1.8K   20  
Unlike Date Dimension (with Year, Month, Date), Time Dimension (with Hour, Minutes, and Seconds) is not automatically created by SSAS (Microsoft SQL Server Analysis Services). This article explains how to create and use Time Dimension in Microsoft SQL Server Analysis Services.
delete from FactSales

insert into dbo.FactSales(TimeKey)
select DATEPART(hour, date_sales)*60*60
      + DATEPART(minute, date_sales)*60
      + DATEPART(second, date_sales) as TimeKey
from FactSales

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
United States United States
Igor is a business intelligence consultant working in Tampa, Florida. He has a BS in Finance from University of South Carolina and Masters in Information Management System from University of South Florida. He also has following professional certifications: MCSD, MCDBA, MCAD.

Comments and Discussions