Click here to Skip to main content
12,303,777 members (74,428 online)
Click here to Skip to main content
Articles » Database » Database » SQL Server » Downloads

Stats

64.1K views
1.5K downloads
20 bookmarked
Posted

Creating Time Dimension in Microsoft Analysis Services

, 6 May 2008 CPOL
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.
��USE [DW_DATAMART]

GO

/****** Object:  Table [dbo].[DimTime]    Script Date: 04/08/2008 14:55:11 ******/

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

SET ANSI_PADDING ON

GO

CREATE TABLE [dbo].[DimTime](

	[DimTimeKey] [int] NOT NULL,

	[Time] [varchar](50) NOT NULL,

	[Time24] [varchar](50) NOT NULL,

	[Hour] [tinyint] NOT NULL,

	[HourName] [varchar](10) NOT NULL,

	[Minute] [tinyint] NOT NULL,

	[MinuteKey] [int] NOT NULL,

	[MinuteName] [varchar](20) NOT NULL,

	[Second] [tinyint] NOT NULL,

	[Hour24] [tinyint] NOT NULL,

	[AM] [char](2) NOT NULL,

 CONSTRAINT [PK_DimTime] PRIMARY KEY CLUSTERED 

(

	[DimTimeKey] ASC

)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]

) ON [PRIMARY]



GO

SET ANSI_PADDING OFF

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)

Share

About the Author

Igor Krupitsky
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.

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.160530.1 | Last Updated 6 May 2008
Article Copyright 2008 by Igor Krupitsky
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid