Advertisement
bdill

DimDates_Create_DDL.sql

Oct 30th, 2019
383
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
T-SQL 1.98 KB | None | 0 0
  1. CREATE TABLE [dbo].[DimDates] (
  2.     [DateID] [INT] NOT NULL,
  3.     [Date] [DATE] NULL,
  4.     [NextDayDate] [DATE] NULL,
  5.     [CalendarYear] [INT] NULL,
  6.     [CalendarYearQuarter] [INT] NULL,
  7.     [CalendarYearMonth] [INT] NULL,
  8.     [CalendarYearDayOfYear] [INT] NULL,
  9.     [CalendarQuarter] [TINYINT] NULL,
  10.     [CalendarMonth] [TINYINT] NULL,
  11.     [CalendarDayOfYear] [INT] NULL,
  12.     [CalendarDayOfMonth] [TINYINT] NULL,
  13.     [CalendarDayOfWeek] [TINYINT] NULL,
  14.     [CalendarYearName] [VARCHAR](4) NULL,
  15.     [CalendarYearQuarterName] [VARCHAR](7) NULL,
  16.     [CalendarYearMonthName] [VARCHAR](8) NULL,
  17.     [CalendarYearMonthNameLong] [VARCHAR](14) NULL,
  18.     [CalendarQuarterName] [VARCHAR](2) NULL,
  19.     [CalendarMonthName] [VARCHAR](3) NULL,
  20.     [CalendarMonthNameLong] [VARCHAR](9) NULL,
  21.     [WeekdayName] [VARCHAR](3) NULL,
  22.     [WeekdayNameLong] [VARCHAR](9) NULL,
  23.     [QuarterSeqNo] [INT] NULL,
  24.     [MonthSeqNo] [INT] NULL,
  25.     [ISODate] [CHAR](10) NULL,
  26.     [ISOYearWeekNumber] [INT] NULL,
  27.     [ISOWeekNumber] [TINYINT] NULL,
  28.     [ISODayOfWeek] [TINYINT] NULL,
  29.     [ISOYearWeekName] [CHAR](8) NULL,
  30.     [DateFormatYYYY_MM_DD] [CHAR](10) NULL,
  31.     [DateFormatYYYY_M_D] [VARCHAR](10) NULL,
  32.     [DateFormatMM_DD_YYYY] [CHAR](10) NULL,
  33.     [DateFormat_M_DYYYY] [VARCHAR](10) NULL,
  34.     [DateFormat_MMM_D_YYYY] [VARCHAR](20) NULL,
  35.     [DateFormat_Month_D_YYYY] [VARCHAR](20) NULL,
  36.     [DateFormat_MM_DD_YY] [CHAR](8) NULL,
  37.     [DateFormat_M_D_YY] [VARCHAR](8) NULL,
  38.     [CalendarStartOfYearDate] [DATE] NULL,
  39.     [CalendarEndOfYearDate] [DATE] NULL,
  40.     [CalendarStartOfQuarterDate] [DATE] NULL,
  41.     [CalendarEndOfQuarterDate] [DATE] NULL,
  42.     [CalendarStartOfMonthDate] [DATE] NULL,
  43.     [CalendarEndOfMonthDate] [DATE] NULL,
  44.     [StartOfWeekStartingSunDate] [DATE] NULL,
  45.     [EndOfWeekStartingSunDate] [DATE] NULL,
  46.     [StartOfWeekStartingMonDate] [DATE] NULL,
  47.     [EndOfWeekStartingMonDate] [DATE] NULL,
  48.  CONSTRAINT [PK_DimDates] PRIMARY KEY CLUSTERED
  49. (
  50.     [DateID] ASC
  51. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  52. ) ON [PRIMARY]
  53.  
  54. GO
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement