从哪里获得SSAS Labs的vDateFeed视图定义?

时间:2012-01-01 04:04:12

标签: sql-server-2008 ssas

我已经下载并安装了Adventure Works数据库,以便与SSAS实验室和视频一起使用。

然而,他们似乎都使用了一个名为vDateFeed的视图,该视图在数据源和设置文件中不存在。所以这基本上结束了使用教程。似乎没有任何地方可以下载此视图定义。

有没有人拥有它,如果可以,请在这里发布?

2 个答案:

答案 0 :(得分:1)

请安装SQL Server 2008 R2 Update for Developers Training Kit (May 2011 Update),并尝试从此工具包执行Setup_AdventureWorksDW2008R2.sql。此脚本有许多实例,其中一个位于以下文件夹中:{training kit安装文件夹} \ Demos \ SQL10R2BYFBI00-DEMO-01 \ Source \ Setup \ scripts \ Tasks \ sql。此脚本包含用于创建vDateFeed的代码。

答案 1 :(得分:1)

我刚刚进入虚拟实验室。如果需要快捷方式,则视图定义为

CREATE VIEW [dbo].[vDateFeed]
AS
    SELECT
        [DateKey],
        [FullDateAlternateKey] AS [Date],
        CAST([CalendarYear] AS NCHAR(4)) + N' ' + LEFT([EnglishMonthName], 3) + N', ' + CASE WHEN [DayNumberOfMonth] < 10 THEN N'0' ELSE N'' END + CAST([DayNumberOfMonth] AS NVARCHAR(2)) AS [DateLabel],
        (([CalendarYear] * 100) + [MonthNumberOfYear]) AS [MonthKey],
        CAST([CalendarYear] AS NCHAR(4)) + N' ' + LEFT([EnglishMonthName], 3) AS [MonthLabel],
        [MonthNumberOfYear] AS [MonthOfYearKey],
        LEFT([EnglishMonthName], 3) AS [MonthOfYearLabel],
        (([CalendarYear] * 10) + [CalendarQuarter]) AS [CalendarQuarterKey],
        N'CY' + CAST([CalendarYear] AS NCHAR(4)) + N' Q' + CAST([CalendarQuarter] AS NCHAR(1)) AS [CalendarQuarterLabel],
        [CalendarQuarter] AS [CalendarQuarterOfYearKey],
        N'CY Q' + CAST([CalendarQuarter] AS NCHAR(1)) AS [CalendarQuarterOfYearLabel],
        [CalendarYear] AS [CalendarYearKey],
        N'CY' + CAST([CalendarYear] AS NCHAR(4)) AS [CalendarYearLabel]
    FROM
        [dbo].[DimDate];
GO