1|2010-09-30 11:12:47.467000000|dbo|CREATE_TABLE|dbo|AdventureWorksDWBuildVersion|CREATE TABLE [dbo].[AdventureWorksDWBuildVersion] (
[DBVersion] [nvarchar] (50) NULL,
[VersionDate] [datetime] NULL
) ON [PRIMARY];
|CREATE_TABLE2010-09-30T11:12:47.45351JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboAdventureWorksDWBuildVersionTABLECREATE TABLE [dbo].[AdventureWorksDWBuildVersion] (
[DBVersion] [nvarchar] (50) NULL,
[VersionDate] [datetime] NULL
) ON [PRIMARY];
2|2010-09-30 11:12:47.470000000|dbo|CREATE_TABLE|dbo|DimAccount|CREATE TABLE [dbo].[DimAccount] (
[AccountKey] [int] IDENTITY(1, 1) NOT NULL,
[ParentAccountKey] [int] NULL,
[AccountCodeAlternateKey] [int] NULL,
[ParentAccountCodeAlternateKey] [int] NULL,
[AccountDescription] [nvarchar] (50) NULL,
[AccountType] [nvarchar] (50) NULL,
[Operator] [nvarchar] (50) NULL,
[CustomMembers] [nvarchar] (300) NULL,
[ValueType] [nvarchar] (50) NULL,
[CustomMemberOptions] [nvarchar] (200) NULL
) ON [PRIMARY];
|CREATE_TABLE2010-09-30T11:12:47.47051JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboDimAccountTABLECREATE TABLE [dbo].[DimAccount] (
[AccountKey] [int] IDENTITY(1, 1) NOT NULL,
[ParentAccountKey] [int] NULL,
[AccountCodeAlternateKey] [int] NULL,
[ParentAccountCodeAlternateKey] [int] NULL,
[AccountDescription] [nvarchar] (50) NULL,
[AccountType] [nvarchar] (50) NULL,
[Operator] [nvarchar] (50) NULL,
[CustomMembers] [nvarchar] (300) NULL,
[ValueType] [nvarchar] (50) NULL,
[CustomMemberOptions] [nvarchar] (200) NULL
) ON [PRIMARY];
17|2010-09-30 11:12:47.540000000|dbo|CREATE_TABLE|dbo|DimScenario|CREATE TABLE [dbo].[DimScenario] (
[ScenarioKey] [int] IDENTITY(1, 1) NOT NULL,
[ScenarioName] [nvarchar] (50) NULL
) ON [PRIMARY];
|CREATE_TABLE2010-09-30T11:12:47.53751JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboDimScenarioTABLECREATE TABLE [dbo].[DimScenario] (
[ScenarioKey] [int] IDENTITY(1, 1) NOT NULL,
[ScenarioName] [nvarchar] (50) NULL
) ON [PRIMARY];
56|2010-09-30 11:12:52.743000000|dbo|CREATE_INDEX|dbo|IX_DimEmployee_SalesTerritoryKey|CREATE INDEX [IX_DimEmployee_SalesTerritoryKey] ON [dbo].[DimEmployee]([SalesTerritoryKey]) ON [PRIMARY];
|CREATE_INDEX2010-09-30T11:12:52.74351JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboIX_DimEmployee_SalesTerritoryKeyINDEXDimEmployeeTABLECREATE INDEX [IX_DimEmployee_SalesTerritoryKey] ON [dbo].[DimEmployee]([SalesTerritoryKey]) ON [PRIMARY];
3|2010-09-30 11:12:47.473000000|dbo|CREATE_TABLE|dbo|DimCurrency|CREATE TABLE [dbo].[DimCurrency] (
[CurrencyKey] [int] IDENTITY(1, 1) NOT NULL,
[CurrencyAlternateKey] [nchar] (3) NOT NULL,
[CurrencyName] [nvarchar] (50) NOT NULL
) ON [PRIMARY];
|CREATE_TABLE2010-09-30T11:12:47.47351JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboDimCurrencyTABLECREATE TABLE [dbo].[DimCurrency] (
[CurrencyKey] [int] IDENTITY(1, 1) NOT NULL,
[CurrencyAlternateKey] [nchar] (3) NOT NULL,
[CurrencyName] [nvarchar] (50) NOT NULL
) ON [PRIMARY];
6|2010-09-30 11:12:47.480000000|dbo|CREATE_TABLE|dbo|DimDepartmentGroup|CREATE TABLE [dbo].[DimDepartmentGroup] (
[DepartmentGroupKey] [int] IDENTITY(1, 1) NOT NULL,
[ParentDepartmentGroupKey] [int] NULL,
[DepartmentGroupName] [nvarchar] (50) NULL
) ON [PRIMARY];
|CREATE_TABLE2010-09-30T11:12:47.48051JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboDimDepartmentGroupTABLECREATE TABLE [dbo].[DimDepartmentGroup] (
[DepartmentGroupKey] [int] IDENTITY(1, 1) NOT NULL,
[ParentDepartmentGroupKey] [int] NULL,
[DepartmentGroupName] [nvarchar] (50) NULL
) ON [PRIMARY];
8|2010-09-30 11:12:47.497000000|dbo|CREATE_TABLE|dbo|DimGeography|CREATE TABLE [dbo].[DimGeography] (
[GeographyKey] [int] IDENTITY(1, 1) NOT NULL,
[City] [nvarchar] (30) NULL,
[StateProvinceCode] [nvarchar] (3) NULL,
[StateProvinceName] [nvarchar] (50) NULL,
[CountryRegionCode] [nvarchar] (3) NULL,
[EnglishCountryRegionName] [nvarchar] (50) NULL,
[SpanishCountryRegionName] [nvarchar] (50) NULL,
[FrenchCountryRegionName] [nvarchar] (50) NULL,
[PostalCode] [nvarchar] (15) NULL,
[SalesTerritoryKey] [int] NULL
) ON [PRIMARY];
|CREATE_TABLE2010-09-30T11:12:47.49751JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboDimGeographyTABLECREATE TABLE [dbo].[DimGeography] (
[GeographyKey] [int] IDENTITY(1, 1) NOT NULL,
[City] [nvarchar] (30) NULL,
[StateProvinceCode] [nvarchar] (3) NULL,
[StateProvinceName] [nvarchar] (50) NULL,
[CountryRegionCode] [nvarchar] (3) NULL,
[EnglishCountryRegionName] [nvarchar] (50) NULL,
[SpanishCountryRegionName] [nvarchar] (50) NULL,
[FrenchCountryRegionName] [nvarchar] (50) NULL,
[PostalCode] [nvarchar] (15) NULL,
[SalesTerritoryKey] [int] NULL
) ON [PRIMARY];
4|2010-09-30 11:12:47.477000000|dbo|CREATE_TABLE|dbo|DimCustomer|CREATE TABLE [dbo].[DimCustomer] (
[CustomerKey] [int] IDENTITY(1, 1) NOT NULL,
[GeographyKey] [int] NULL,
[CustomerAlternateKey] [nvarchar] (15) NOT NULL,
[Title] [nvarchar] (8) NULL,
[FirstName] [nvarchar] (50) NULL,
[MiddleName] [nvarchar] (50) NULL,
[LastName] [nvarchar] (50) NULL,
[NameStyle] [bit] NULL,
[BirthDate] [date] NULL,
[MaritalStatus] [nchar] (1) NULL,
[Suffix] [nvarchar] (10) NULL,
[Gender] [nvarchar] (1) NULL,
[EmailAddress] [nvarchar] (50) NULL,
[YearlyIncome] [money] NULL,
[TotalChildren] [tinyint] NULL,
[NumberChildrenAtHome] [tinyint] NULL,
[EnglishEducation] [nvarchar] (40) NULL,
[SpanishEducation] [nvarchar] (40) NULL,
[FrenchEducation] [nvarchar] (40) NULL,
[EnglishOccupation] [nvarchar] (100) NULL,
[SpanishOccupation] [nvarchar] (100) NULL,
[FrenchOccupation] [nvarchar] (100) NULL,
[HouseOwnerFlag] [nchar] (1) NULL,
[NumberCarsOwned] [tinyint] NULL,
[AddressLine1] [nvarchar] (120) NULL,
[AddressLine2] [nvarchar] (120) NULL,
[Phone] [nvarchar] (20) NULL,
[DateFirstPurchase] [date] NULL,
[CommuteDistance] [nvarchar] (15) NULL
) ON [PRIMARY];
|CREATE_TABLE2010-09-30T11:12:47.47351JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboDimCustomerTABLECREATE TABLE [dbo].[DimCustomer] (
[CustomerKey] [int] IDENTITY(1, 1) NOT NULL,
[GeographyKey] [int] NULL,
[CustomerAlternateKey] [nvarchar] (15) NOT NULL,
[Title] [nvarchar] (8) NULL,
[FirstName] [nvarchar] (50) NULL,
[MiddleName] [nvarchar] (50) NULL,
[LastName] [nvarchar] (50) NULL,
[NameStyle] [bit] NULL,
[BirthDate] [date] NULL,
[MaritalStatus] [nchar] (1) NULL,
[Suffix] [nvarchar] (10) NULL,
[Gender] [nvarchar] (1) NULL,
[EmailAddress] [nvarchar] (50) NULL,
[YearlyIncome] [money] NULL,
[TotalChildren] [tinyint] NULL,
[NumberChildrenAtHome] [tinyint] NULL,
[EnglishEducation] [nvarchar] (40) NULL,
[SpanishEducation] [nvarchar] (40) NULL,
[FrenchEducation] [nvarchar] (40) NULL,
[EnglishOccupation] [nvarchar] (100) NULL,
[SpanishOccupation] [nvarchar] (100) NULL,
[FrenchOccupation] [nvarchar] (100) NULL,
[HouseOwnerFlag] [nchar] (1) NULL,
[NumberCarsOwned] [tinyint] NULL,
[AddressLine1] [nvarchar] (120) NULL,
[AddressLine2] [nvarchar] (120) NULL,
[Phone] [nvarchar] (20) NULL,
[DateFirstPurchase] [date] NULL,
[CommuteDistance] [nvarchar] (15) NULL
) ON [PRIMARY];
68|2010-09-30 11:12:53.030000000|dbo|CREATE_INDEX|dbo|IX_FactInternetSales_CustomerKey|CREATE INDEX [IX_FactInternetSales_CustomerKey] ON [dbo].[FactInternetSales]([CustomerKey]) ON [PRIMARY];
|CREATE_INDEX2010-09-30T11:12:53.02751JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboIX_FactInternetSales_CustomerKeyINDEXFactInternetSalesTABLECREATE INDEX [IX_FactInternetSales_CustomerKey] ON [dbo].[FactInternetSales]([CustomerKey]) ON [PRIMARY];
5|2010-09-30 11:12:47.477000000|dbo|CREATE_TABLE|dbo|DimDate|CREATE TABLE [dbo].[DimDate] (
[DateKey] int NOT NULL,
[FullDateAlternateKey] [date] NOT NULL,
[DayNumberOfWeek] [tinyint] NOT NULL,
[EnglishDayNameOfWeek] [nvarchar] (10) NOT NULL,
[SpanishDayNameOfWeek] [nvarchar] (10) NOT NULL,
[FrenchDayNameOfWeek] [nvarchar] (10) NOT NULL,
[DayNumberOfMonth] [tinyint] NOT NULL,
[DayNumberOfYear] [smallint] NOT NULL,
[WeekNumberOfYear] [tinyint] NOT NULL,
[EnglishMonthName] [nvarchar] (10) NOT NULL,
[SpanishMonthName] [nvarchar] (10) NOT NULL,
[FrenchMonthName] [nvarchar] (10) NOT NULL,
[MonthNumberOfYear] [tinyint] NOT NULL,
[CalendarQuarter] [tinyint] NOT NULL,
[CalendarYear] [smallint] NOT NULL,
[CalendarSemester] [tinyint] NOT NULL,
[FiscalQuarter] [tinyint] NOT NULL,
[FiscalYear] [smallint] NOT NULL,
[FiscalSemester] [tinyint] NOT NULL
) ON [PRIMARY];
|CREATE_TABLE2010-09-30T11:12:47.47751JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboDimDateTABLECREATE TABLE [dbo].[DimDate] (
[DateKey] int NOT NULL,
[FullDateAlternateKey] [date] NOT NULL,
[DayNumberOfWeek] [tinyint] NOT NULL,
[EnglishDayNameOfWeek] [nvarchar] (10) NOT NULL,
[SpanishDayNameOfWeek] [nvarchar] (10) NOT NULL,
[FrenchDayNameOfWeek] [nvarchar] (10) NOT NULL,
[DayNumberOfMonth] [tinyint] NOT NULL,
[DayNumberOfYear] [smallint] NOT NULL,
[WeekNumberOfYear] [tinyint] NOT NULL,
[EnglishMonthName] [nvarchar] (10) NOT NULL,
[SpanishMonthName] [nvarchar] (10) NOT NULL,
[FrenchMonthName] [nvarchar] (10) NOT NULL,
[MonthNumberOfYear] [tinyint] NOT NULL,
[CalendarQuarter] [tinyint] NOT NULL,
[CalendarYear] [smallint] NOT NULL,
[CalendarSemester] [tinyint] NOT NULL,
[FiscalQuarter] [tinyint] NOT NULL,
[FiscalYear] [smallint] NOT NULL,
[FiscalSemester] [tinyint] NOT NULL
) ON [PRIMARY];
70|2010-09-30 11:12:53.223000000|dbo|CREATE_INDEX|dbo|IX_FactInternetSales_OrderDateKey|CREATE INDEX [IX_FactInternetSales_OrderDateKey] ON [dbo].[FactInternetSales]([OrderDateKey]) ON [PRIMARY];
|CREATE_INDEX2010-09-30T11:12:53.22351JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboIX_FactInternetSales_OrderDateKeyINDEXFactInternetSalesTABLECREATE INDEX [IX_FactInternetSales_OrderDateKey] ON [dbo].[FactInternetSales]([OrderDateKey]) ON [PRIMARY];
72|2010-09-30 11:12:53.623000000|dbo|CREATE_INDEX|dbo|IX_FactInternetSales_PromotionKey|CREATE INDEX [IX_FactInternetSales_PromotionKey] ON [dbo].[FactInternetSales]([PromotionKey]) ON [PRIMARY];
|CREATE_INDEX2010-09-30T11:12:53.62351JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboIX_FactInternetSales_PromotionKeyINDEXFactInternetSalesTABLECREATE INDEX [IX_FactInternetSales_PromotionKey] ON [dbo].[FactInternetSales]([PromotionKey]) ON [PRIMARY];
7|2010-09-30 11:12:47.493000000|dbo|CREATE_TABLE|dbo|DimEmployee|CREATE TABLE [dbo].[DimEmployee] (
[EmployeeKey] [int] IDENTITY(1, 1) NOT NULL,
[ParentEmployeeKey] [int] NULL,
[EmployeeNationalIDAlternateKey] [nvarchar] (15) NULL,
[ParentEmployeeNationalIDAlternateKey] [nvarchar] (15) NULL,
[SalesTerritoryKey] [int] NULL,
[FirstName] [nvarchar] (50) NOT NULL,
[LastName] [nvarchar] (50) NOT NULL,
[MiddleName] [nvarchar] (50) NULL,
[NameStyle] [bit] NOT NULL,
[Title] [nvarchar] (50) NULL,
[HireDate] [date] NULL,
[BirthDate] [date] NULL,
[LoginID] [nvarchar] (256) NULL,
[EmailAddress] [nvarchar] (50) NULL,
[Phone] [nvarchar] (25) NULL,
[MaritalStatus] [nchar] (1) NULL,
[EmergencyContactName] [nvarchar] (50) NULL,
[EmergencyContactPhone] [nvarchar] (25) NULL,
[SalariedFlag] [bit] NULL,
[Gender] [nchar] (1) NULL,
[PayFrequency] [tinyint] NULL,
[BaseRate] [money] NULL,
[VacationHours] [smallint] NULL,
[SickLeaveHours] [smallint] NULL,
[CurrentFlag] [bit] NOT NULL,
[SalesPersonFlag] [bit] NOT NULL,
[DepartmentName] [nvarchar] (50) NULL,
[StartDate] [date] NULL,
[EndDate] [date] NULL,
[Status] [nvarchar] (50)
) ON [PRIMARY];
|CREATE_TABLE2010-09-30T11:12:47.49351JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboDimEmployeeTABLECREATE TABLE [dbo].[DimEmployee] (
[EmployeeKey] [int] IDENTITY(1, 1) NOT NULL,
[ParentEmployeeKey] [int] NULL,
[EmployeeNationalIDAlternateKey] [nvarchar] (15) NULL,
[ParentEmployeeNationalIDAlternateKey] [nvarchar] (15) NULL,
[SalesTerritoryKey] [int] NULL,
[FirstName] [nvarchar] (50) NOT NULL,
[LastName] [nvarchar] (50) NOT NULL,
[MiddleName] [nvarchar] (50) NULL,
[NameStyle] [bit] NOT NULL,
[Title] [nvarchar] (50) NULL,
[HireDate] [date] NULL,
[BirthDate] [date] NULL,
[LoginID] [nvarchar] (256) NULL,
[EmailAddress] [nvarchar] (50) NULL,
[Phone] [nvarchar] (25) NULL,
[MaritalStatus] [nchar] (1) NULL,
[EmergencyContactName] [nvarchar] (50) NULL,
[EmergencyContactPhone] [nvarchar] (25) NULL,
[SalariedFlag] [bit] NULL,
[Gender] [nchar] (1) NULL,
[PayFrequency] [tinyint] NULL,
[BaseRate] [money] NULL,
[VacationHours] [smallint] NULL,
[SickLeaveHours] [smallint] NULL,
[CurrentFlag] [bit] NOT NULL,
[SalesPersonFlag] [bit] NOT NULL,
[DepartmentName] [nvarchar] (50) NULL,
[StartDate] [date] NULL,
[EndDate] [date] NULL,
[Status] [nvarchar] (50)
) ON [PRIMARY];
78|2010-09-30 11:12:54.727000000|dbo|CREATE_INDEX|dbo|IX_FactResellerSales_PromotionKey|CREATE INDEX [IX_FactResellerSales_PromotionKey] ON [dbo].[FactResellerSales]([PromotionKey]) ON [PRIMARY];
|CREATE_INDEX2010-09-30T11:12:54.72751JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboIX_FactResellerSales_PromotionKeyINDEXFactResellerSalesTABLECREATE INDEX [IX_FactResellerSales_PromotionKey] ON [dbo].[FactResellerSales]([PromotionKey]) ON [PRIMARY];
9|2010-09-30 11:12:47.497000000|dbo|CREATE_TABLE|dbo|DimOrganization|CREATE TABLE [dbo].[DimOrganization] (
[OrganizationKey] [int] IDENTITY(1, 1) NOT NULL,
[ParentOrganizationKey] [int] NULL,
[PercentageOfOwnership] [nvarchar] (16) NULL,
[OrganizationName] [nvarchar] (50) NULL,
[CurrencyKey] [int] NULL
) ON [PRIMARY];
|CREATE_TABLE2010-09-30T11:12:47.49751JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboDimOrganizationTABLECREATE TABLE [dbo].[DimOrganization] (
[OrganizationKey] [int] IDENTITY(1, 1) NOT NULL,
[ParentOrganizationKey] [int] NULL,
[PercentageOfOwnership] [nvarchar] (16) NULL,
[OrganizationName] [nvarchar] (50) NULL,
[CurrencyKey] [int] NULL
) ON [PRIMARY];
11|2010-09-30 11:12:47.527000000|dbo|CREATE_TABLE|dbo|DimProductCategory|CREATE TABLE [dbo].[DimProductCategory] (
[ProductCategoryKey] [int] IDENTITY(1, 1) NOT NULL,
[ProductCategoryAlternateKey] [int] NULL,
[EnglishProductCategoryName] [nvarchar] (50) NOT NULL,
[SpanishProductCategoryName] [nvarchar] (50) NOT NULL,
[FrenchProductCategoryName] [nvarchar] (50) NOT NULL
) ON [PRIMARY];
|CREATE_TABLE2010-09-30T11:12:47.52751JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboDimProductCategoryTABLECREATE TABLE [dbo].[DimProductCategory] (
[ProductCategoryKey] [int] IDENTITY(1, 1) NOT NULL,
[ProductCategoryAlternateKey] [int] NULL,
[EnglishProductCategoryName] [nvarchar] (50) NOT NULL,
[SpanishProductCategoryName] [nvarchar] (50) NOT NULL,
[FrenchProductCategoryName] [nvarchar] (50) NOT NULL
) ON [PRIMARY];
80|2010-09-30 11:12:55.477000000|dbo|CREATE_INDEX|dbo|IX_FactResellerSales_EmployeeKey|CREATE INDEX [IX_FactResellerSales_EmployeeKey] ON [dbo].[FactResellerSales]([EmployeeKey]) ON [PRIMARY];
|CREATE_INDEX2010-09-30T11:12:55.47751JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboIX_FactResellerSales_EmployeeKeyINDEXFactResellerSalesTABLECREATE INDEX [IX_FactResellerSales_EmployeeKey] ON [dbo].[FactResellerSales]([EmployeeKey]) ON [PRIMARY];
83|2010-09-30 11:12:55.630000000|dbo|CREATE_INDEX|dbo|IX_FactSalesQuota_DateKey|CREATE INDEX [IX_FactSalesQuota_DateKey] ON [dbo].[FactSalesQuota]([DateKey]) ON [PRIMARY];
|CREATE_INDEX2010-09-30T11:12:55.63051JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboIX_FactSalesQuota_DateKeyINDEXFactSalesQuotaTABLECREATE INDEX [IX_FactSalesQuota_DateKey] ON [dbo].[FactSalesQuota]([DateKey]) ON [PRIMARY];
10|2010-09-30 11:12:47.523000000|dbo|CREATE_TABLE|dbo|DimProduct|CREATE TABLE [dbo].[DimProduct] (
[ProductKey] [int] IDENTITY(1,1) NOT NULL,
[ProductAlternateKey] [nvarchar] (25) NULL,
[ProductSubcategoryKey] [int] NULL,
[WeightUnitMeasureCode] [nchar] (3) NULL,
[SizeUnitMeasureCode] [nchar] (3) NULL,
[EnglishProductName] [nvarchar] (50) NOT NULL,
[SpanishProductName] [nvarchar] (50) NOT NULL,
[FrenchProductName] [nvarchar] (50) NOT NULL,
[StandardCost] [money] NULL,
[FinishedGoodsFlag] [bit] NOT NULL,
[Color] [nvarchar] (15) NOT NULL,
[SafetyStockLevel] [smallint] NULL,
[ReorderPoint] [smallint] NULL,
[ListPrice] [money] NULL,
[Size] [nvarchar] (50) NULL,
[SizeRange] [nvarchar] (50) NULL,
[Weight] [float] NULL,
[DaysToManufacture] [int] NULL,
[ProductLine] [nchar] (2) NULL,
[DealerPrice] [money] NULL,
[Class] [nchar] (2) NULL,
[Style] [nchar] (2) NULL,
[ModelName] [nvarchar] (50) NULL,
[LargePhoto] [varbinary] (max) NULL,
[EnglishDescription] [nvarchar] (400) NULL,
[FrenchDescription] [nvarchar] (400) COLLATE French_CI_AS NULL,
[ChineseDescription] [nvarchar] (400) COLLATE Chinese_PRC_CI_AI NULL,
[ArabicDescription] [nvarchar] (400) COLLATE Arabic_CI_AS NULL,
[HebrewDescription] [nvarchar] (400) COLLATE Hebrew_CI_AS NULL,
[ThaiDescription] [nvarchar] (400) COLLATE Thai_CI_AS NULL,
[GermanDescription] [nvarchar] (400) COLLATE Latin1_General_100_CI_AS NULL,
[JapaneseDescription] [nvarchar] (400) COLLATE Japanese_CI_AS NULL,
[TurkishDescription] [nvarchar] (400) COLLATE Turkish_CI_AS NULL,
[StartDate] [datetime] NULL,
[EndDate] [datetime] NULL,
[Status] [nvarchar] (7) NULL
) ON [PRIMARY];
|CREATE_TABLE2010-09-30T11:12:47.52351JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboDimProductTABLECREATE TABLE [dbo].[DimProduct] (
[ProductKey] [int] IDENTITY(1,1) NOT NULL,
[ProductAlternateKey] [nvarchar] (25) NULL,
[ProductSubcategoryKey] [int] NULL,
[WeightUnitMeasureCode] [nchar] (3) NULL,
[SizeUnitMeasureCode] [nchar] (3) NULL,
[EnglishProductName] [nvarchar] (50) NOT NULL,
[SpanishProductName] [nvarchar] (50) NOT NULL,
[FrenchProductName] [nvarchar] (50) NOT NULL,
[StandardCost] [money] NULL,
[FinishedGoodsFlag] [bit] NOT NULL,
[Color] [nvarchar] (15) NOT NULL,
[SafetyStockLevel] [smallint] NULL,
[ReorderPoint] [smallint] NULL,
[ListPrice] [money] NULL,
[Size] [nvarchar] (50) NULL,
[SizeRange] [nvarchar] (50) NULL,
[Weight] [float] NULL,
[DaysToManufacture] [int] NULL,
[ProductLine] [nchar] (2) NULL,
[DealerPrice] [money] NULL,
[Class] [nchar] (2) NULL,
[Style] [nchar] (2) NULL,
[ModelName] [nvarchar] (50) NULL,
[LargePhoto] [varbinary] (max) NULL,
[EnglishDescription] [nvarchar] (400) NULL,
[FrenchDescription] [nvarchar] (400) COLLATE French_CI_AS NULL,
[ChineseDescription] [nvarchar] (400) COLLATE Chinese_PRC_CI_AI NULL,
[ArabicDescription] [nvarchar] (400) COLLATE Arabic_CI_AS NULL,
[HebrewDescription] [nvarchar] (400) COLLATE Hebrew_CI_AS NULL,
[ThaiDescription] [nvarchar] (400) COLLATE Thai_CI_AS NULL,
[GermanDescription] [nvarchar] (400) COLLATE Latin1_General_100_CI_AS NULL,
[JapaneseDescription] [nvarchar] (400) COLLATE Japanese_CI_AS NULL,
[TurkishDescription] [nvarchar] (400) COLLATE Turkish_CI_AS NULL,
[StartDate] [datetime] NULL,
[EndDate] [datetime] NULL,
[Status] [nvarchar] (7) NULL
) ON [PRIMARY];
12|2010-09-30 11:12:47.530000000|dbo|CREATE_TABLE|dbo|DimProductSubcategory|CREATE TABLE [dbo].[DimProductSubcategory] (
[ProductSubcategoryKey] [int] IDENTITY(1, 1) NOT NULL,
[ProductSubcategoryAlternateKey] [int] NULL,
[EnglishProductSubcategoryName] [nvarchar] (50) NOT NULL,
[SpanishProductSubcategoryName] [nvarchar] (50) NOT NULL,
[FrenchProductSubcategoryName] [nvarchar] (50) NOT NULL,
[ProductCategoryKey] [int] NULL
) ON [PRIMARY];
|CREATE_TABLE2010-09-30T11:12:47.52751JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboDimProductSubcategoryTABLECREATE TABLE [dbo].[DimProductSubcategory] (
[ProductSubcategoryKey] [int] IDENTITY(1, 1) NOT NULL,
[ProductSubcategoryAlternateKey] [int] NULL,
[EnglishProductSubcategoryName] [nvarchar] (50) NOT NULL,
[SpanishProductSubcategoryName] [nvarchar] (50) NOT NULL,
[FrenchProductSubcategoryName] [nvarchar] (50) NOT NULL,
[ProductCategoryKey] [int] NULL
) ON [PRIMARY];
13|2010-09-30 11:12:47.530000000|dbo|CREATE_TABLE|dbo|DimPromotion|CREATE TABLE [dbo].[DimPromotion] (
[PromotionKey] [int] IDENTITY(1, 1) NOT NULL,
[PromotionAlternateKey] [int] NULL,
[EnglishPromotionName] [nvarchar] (255) NULL,
[SpanishPromotionName] [nvarchar] (255) NULL,
[FrenchPromotionName] [nvarchar] (255) NULL,
[DiscountPct] [float] NULL,
[EnglishPromotionType] [nvarchar] (50) NULL,
[SpanishPromotionType] [nvarchar] (50) NULL,
[FrenchPromotionType] [nvarchar] (50) NULL,
[EnglishPromotionCategory] [nvarchar] (50) NULL,
[SpanishPromotionCategory] [nvarchar] (50) NULL,
[FrenchPromotionCategory] [nvarchar] (50) NULL,
[StartDate] [datetime] NOT NULL,
[EndDate] [datetime] NULL,
[MinQty] [int] NULL,
[MaxQty] [int] NULL
) ON [PRIMARY];
|CREATE_TABLE2010-09-30T11:12:47.53051JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboDimPromotionTABLECREATE TABLE [dbo].[DimPromotion] (
[PromotionKey] [int] IDENTITY(1, 1) NOT NULL,
[PromotionAlternateKey] [int] NULL,
[EnglishPromotionName] [nvarchar] (255) NULL,
[SpanishPromotionName] [nvarchar] (255) NULL,
[FrenchPromotionName] [nvarchar] (255) NULL,
[DiscountPct] [float] NULL,
[EnglishPromotionType] [nvarchar] (50) NULL,
[SpanishPromotionType] [nvarchar] (50) NULL,
[FrenchPromotionType] [nvarchar] (50) NULL,
[EnglishPromotionCategory] [nvarchar] (50) NULL,
[SpanishPromotionCategory] [nvarchar] (50) NULL,
[FrenchPromotionCategory] [nvarchar] (50) NULL,
[StartDate] [datetime] NOT NULL,
[EndDate] [datetime] NULL,
[MinQty] [int] NULL,
[MaxQty] [int] NULL
) ON [PRIMARY];
14|2010-09-30 11:12:47.533000000|dbo|CREATE_TABLE|dbo|DimReseller|CREATE TABLE [dbo].[DimReseller] (
[ResellerKey] [int] IDENTITY(1, 1) NOT NULL,
[GeographyKey] [int] NULL,
[ResellerAlternateKey] [nvarchar] (15) NULL,
[Phone] [nvarchar] (25) NULL,
[BusinessType] [varchar] (20) NOT NULL,
[ResellerName] [nvarchar] (50) NOT NULL,
[NumberEmployees] [int] NULL,
[OrderFrequency] [char] (1) NULL,
[OrderMonth] [tinyint] NULL,
[FirstOrderYear] [int] NULL,
[LastOrderYear] [int] NULL,
[ProductLine] [nvarchar] (50) NULL,
[AddressLine1] [nvarchar] (60) NULL,
[AddressLine2] [nvarchar] (60) NULL,
[AnnualSales] [money] NULL,
[BankName] [nvarchar] (50) NULL,
[MinPaymentType] [tinyint] NULL,
[MinPaymentAmount] [money] NULL,
[AnnualRevenue] [money] NULL,
[YearOpened] [int] NULL
) ON [PRIMARY];
|CREATE_TABLE2010-09-30T11:12:47.53351JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboDimResellerTABLECREATE TABLE [dbo].[DimReseller] (
[ResellerKey] [int] IDENTITY(1, 1) NOT NULL,
[GeographyKey] [int] NULL,
[ResellerAlternateKey] [nvarchar] (15) NULL,
[Phone] [nvarchar] (25) NULL,
[BusinessType] [varchar] (20) NOT NULL,
[ResellerName] [nvarchar] (50) NOT NULL,
[NumberEmployees] [int] NULL,
[OrderFrequency] [char] (1) NULL,
[OrderMonth] [tinyint] NULL,
[FirstOrderYear] [int] NULL,
[LastOrderYear] [int] NULL,
[ProductLine] [nvarchar] (50) NULL,
[AddressLine1] [nvarchar] (60) NULL,
[AddressLine2] [nvarchar] (60) NULL,
[AnnualSales] [money] NULL,
[BankName] [nvarchar] (50) NULL,
[MinPaymentType] [tinyint] NULL,
[MinPaymentAmount] [money] NULL,
[AnnualRevenue] [money] NULL,
[YearOpened] [int] NULL
) ON [PRIMARY];
85|2010-09-30 11:12:55.643000000|dbo|CREATE_INDEX|dbo|IX_FactSurveyResponse_CustomerKey|CREATE INDEX [IX_FactSurveyResponse_CustomerKey] ON [dbo].[FactSurveyResponse] ([CustomerKey]) ON [PRIMARY];
|CREATE_INDEX2010-09-30T11:12:55.64351JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboIX_FactSurveyResponse_CustomerKeyINDEXFactSurveyResponseTABLECREATE INDEX [IX_FactSurveyResponse_CustomerKey] ON [dbo].[FactSurveyResponse] ([CustomerKey]) ON [PRIMARY];
15|2010-09-30 11:12:47.533000000|dbo|CREATE_TABLE|dbo|DimSalesReason|CREATE TABLE [dbo].[DimSalesReason] (
[SalesReasonKey] [int] IDENTITY(1, 1) NOT NULL,
[SalesReasonAlternateKey] [int] NOT NULL,
[SalesReasonName] [nvarchar] (50) NOT NULL,
[SalesReasonReasonType] [nvarchar] (50) NOT NULL
) ON [PRIMARY];
|CREATE_TABLE2010-09-30T11:12:47.53351JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboDimSalesReasonTABLECREATE TABLE [dbo].[DimSalesReason] (
[SalesReasonKey] [int] IDENTITY(1, 1) NOT NULL,
[SalesReasonAlternateKey] [int] NOT NULL,
[SalesReasonName] [nvarchar] (50) NOT NULL,
[SalesReasonReasonType] [nvarchar] (50) NOT NULL
) ON [PRIMARY];
16|2010-09-30 11:12:47.537000000|dbo|CREATE_TABLE|dbo|DimSalesTerritory|CREATE TABLE [dbo].[DimSalesTerritory] (
[SalesTerritoryKey] [int] IDENTITY(1, 1) NOT NULL,
[SalesTerritoryAlternateKey] [int] NULL,
[SalesTerritoryRegion] [nvarchar] (50) NOT NULL,
[SalesTerritoryCountry] [nvarchar] (50) NOT NULL,
[SalesTerritoryGroup] [nvarchar] (50) NULL
) ON [PRIMARY];
|CREATE_TABLE2010-09-30T11:12:47.53751JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboDimSalesTerritoryTABLECREATE TABLE [dbo].[DimSalesTerritory] (
[SalesTerritoryKey] [int] IDENTITY(1, 1) NOT NULL,
[SalesTerritoryAlternateKey] [int] NULL,
[SalesTerritoryRegion] [nvarchar] (50) NOT NULL,
[SalesTerritoryCountry] [nvarchar] (50) NOT NULL,
[SalesTerritoryGroup] [nvarchar] (50) NULL
) ON [PRIMARY];
18|2010-09-30 11:12:47.540000000|dbo|CREATE_TABLE|dbo|FactCallCenter|CREATE TABLE [dbo].[FactCallCenter] (
[FactCallCenterID] [int] IDENTITY(1,1) NOT NULL,
[DateKey] [int] NOT NULL,
[WageType] [nvarchar](15) NOT NULL,
[Shift] [nvarchar](20) NOT NULL,
[LevelOneOperators] [smallint] NOT NULL,
[LevelTwoOperators] [smallint] NOT NULL,
[TotalOperators] [smallint] NOT NULL,
[Calls] [int] NOT NULL,
[AutomaticResponses] [int] NOT NULL,
[Orders] [int] NOT NULL,
[IssuesRaised] [smallint] NOT NULL,
[AverageTimePerIssue] [smallint] NOT NULL,
[ServiceGrade] [float] NOT NULL
) ON [PRIMARY];
|CREATE_TABLE2010-09-30T11:12:47.54051JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboFactCallCenterTABLECREATE TABLE [dbo].[FactCallCenter] (
[FactCallCenterID] [int] IDENTITY(1,1) NOT NULL,
[DateKey] [int] NOT NULL,
[WageType] [nvarchar](15) NOT NULL,
[Shift] [nvarchar](20) NOT NULL,
[LevelOneOperators] [smallint] NOT NULL,
[LevelTwoOperators] [smallint] NOT NULL,
[TotalOperators] [smallint] NOT NULL,
[Calls] [int] NOT NULL,
[AutomaticResponses] [int] NOT NULL,
[Orders] [int] NOT NULL,
[IssuesRaised] [smallint] NOT NULL,
[AverageTimePerIssue] [smallint] NOT NULL,
[ServiceGrade] [float] NOT NULL
) ON [PRIMARY];
19|2010-09-30 11:12:47.540000000|dbo|CREATE_TABLE|dbo|FactCurrencyRate|CREATE TABLE [dbo].[FactCurrencyRate] (
[CurrencyKey] [int] NOT NULL,
[DateKey] [int] NOT NULL,
[AverageRate] [float] NOT NULL,
[EndOfDayRate] [float] NOT NULL
) ON [PRIMARY];
|CREATE_TABLE2010-09-30T11:12:47.54051JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboFactCurrencyRateTABLECREATE TABLE [dbo].[FactCurrencyRate] (
[CurrencyKey] [int] NOT NULL,
[DateKey] [int] NOT NULL,
[AverageRate] [float] NOT NULL,
[EndOfDayRate] [float] NOT NULL
) ON [PRIMARY];
20|2010-09-30 11:12:47.543000000|dbo|CREATE_TABLE|dbo|FactFinance|CREATE TABLE [dbo].[FactFinance] (
[FinanceKey] [int] IDENTITY(1, 1) NOT NULL,
[DateKey] [int] NOT NULL,
[OrganizationKey] [int] NOT NULL,
[DepartmentGroupKey] [int] NOT NULL,
[ScenarioKey] [int] NOT NULL,
[AccountKey] [int] NOT NULL,
[Amount] [float] NOT NULL
) ON [PRIMARY];
|CREATE_TABLE2010-09-30T11:12:47.54351JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboFactFinanceTABLECREATE TABLE [dbo].[FactFinance] (
[FinanceKey] [int] IDENTITY(1, 1) NOT NULL,
[DateKey] [int] NOT NULL,
[OrganizationKey] [int] NOT NULL,
[DepartmentGroupKey] [int] NOT NULL,
[ScenarioKey] [int] NOT NULL,
[AccountKey] [int] NOT NULL,
[Amount] [float] NOT NULL
) ON [PRIMARY];
21|2010-09-30 11:12:47.547000000|dbo|CREATE_TABLE|dbo|FactInternetSales|CREATE TABLE [dbo].[FactInternetSales] (
[ProductKey] [int] NOT NULL,
[OrderDateKey] [int] NOT NULL,
[DueDateKey] [int] NOT NULL,
[ShipDateKey] [int] NOT NULL,
[CustomerKey] [int] NOT NULL,
[PromotionKey] [int] NOT NULL,
[CurrencyKey] [int] NOT NULL,
[SalesTerritoryKey] [int] NOT NULL,
[SalesOrderNumber] [nvarchar] (20) NOT NULL,
[SalesOrderLineNumber] [tinyint] NOT NULL,
[RevisionNumber] [tinyint] NOT NULL,
[OrderQuantity] [smallint] NOT NULL,
[UnitPrice] [money] NOT NULL,
[ExtendedAmount] [money] NOT NULL,
[UnitPriceDiscountPct] [float] NOT NULL,
[DiscountAmount] [float] NOT NULL,
[ProductStandardCost] [money] NOT NULL,
[TotalProductCost] [money] NOT NULL,
[SalesAmount] [money] NOT NULL,
[TaxAmt] [money] NOT NULL,
[Freight] [money] NOT NULL,
[CarrierTrackingNumber] [nvarchar] (25) NULL,
[CustomerPONumber] [nvarchar] (25) NULL
) ON [PRIMARY];
|CREATE_TABLE2010-09-30T11:12:47.54751JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboFactInternetSalesTABLECREATE TABLE [dbo].[FactInternetSales] (
[ProductKey] [int] NOT NULL,
[OrderDateKey] [int] NOT NULL,
[DueDateKey] [int] NOT NULL,
[ShipDateKey] [int] NOT NULL,
[CustomerKey] [int] NOT NULL,
[PromotionKey] [int] NOT NULL,
[CurrencyKey] [int] NOT NULL,
[SalesTerritoryKey] [int] NOT NULL,
[SalesOrderNumber] [nvarchar] (20) NOT NULL,
[SalesOrderLineNumber] [tinyint] NOT NULL,
[RevisionNumber] [tinyint] NOT NULL,
[OrderQuantity] [smallint] NOT NULL,
[UnitPrice] [money] NOT NULL,
[ExtendedAmount] [money] NOT NULL,
[UnitPriceDiscountPct] [float] NOT NULL,
[DiscountAmount] [float] NOT NULL,
[ProductStandardCost] [money] NOT NULL,
[TotalProductCost] [money] NOT NULL,
[SalesAmount] [money] NOT NULL,
[TaxAmt] [money] NOT NULL,
[Freight] [money] NOT NULL,
[CarrierTrackingNumber] [nvarchar] (25) NULL,
[CustomerPONumber] [nvarchar] (25) NULL
) ON [PRIMARY];
22|2010-09-30 11:12:47.550000000|dbo|CREATE_TABLE|dbo|FactResellerSales|CREATE TABLE [dbo].[FactResellerSales] (
[ProductKey] [int] NOT NULL,
[OrderDateKey] [int] NOT NULL,
[DueDateKey] [int] NOT NULL,
[ShipDateKey] [int] NOT NULL,
[ResellerKey] [int] NOT NULL,
[EmployeeKey] [int] NOT NULL,
[PromotionKey] [int] NOT NULL,
[CurrencyKey] [int] NOT NULL,
[SalesTerritoryKey] [int] NOT NULL,
[SalesOrderNumber] [nvarchar] (20) NOT NULL,
[SalesOrderLineNumber] [tinyint] NOT NULL,
[RevisionNumber] [tinyint] NULL,
[OrderQuantity] [smallint] NULL,
[UnitPrice] [money] NULL,
[ExtendedAmount] [money] NULL,
[UnitPriceDiscountPct] [float] NULL,
[DiscountAmount] [float] NULL,
[ProductStandardCost] [money] NULL,
[TotalProductCost] [money] NULL,
[SalesAmount] [money] NULL,
[TaxAmt] [money] NULL,
[Freight] [money] NULL,
[CarrierTrackingNumber] [nvarchar] (25) NULL,
[CustomerPONumber] [nvarchar] (25) NULL
) ON [PRIMARY];
|CREATE_TABLE2010-09-30T11:12:47.54751JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboFactResellerSalesTABLECREATE TABLE [dbo].[FactResellerSales] (
[ProductKey] [int] NOT NULL,
[OrderDateKey] [int] NOT NULL,
[DueDateKey] [int] NOT NULL,
[ShipDateKey] [int] NOT NULL,
[ResellerKey] [int] NOT NULL,
[EmployeeKey] [int] NOT NULL,
[PromotionKey] [int] NOT NULL,
[CurrencyKey] [int] NOT NULL,
[SalesTerritoryKey] [int] NOT NULL,
[SalesOrderNumber] [nvarchar] (20) NOT NULL,
[SalesOrderLineNumber] [tinyint] NOT NULL,
[RevisionNumber] [tinyint] NULL,
[OrderQuantity] [smallint] NULL,
[UnitPrice] [money] NULL,
[ExtendedAmount] [money] NULL,
[UnitPriceDiscountPct] [float] NULL,
[DiscountAmount] [float] NULL,
[ProductStandardCost] [money] NULL,
[TotalProductCost] [money] NULL,
[SalesAmount] [money] NULL,
[TaxAmt] [money] NULL,
[Freight] [money] NULL,
[CarrierTrackingNumber] [nvarchar] (25) NULL,
[CustomerPONumber] [nvarchar] (25) NULL
) ON [PRIMARY];
23|2010-09-30 11:12:47.550000000|dbo|CREATE_TABLE|dbo|FactInternetSalesReason|CREATE TABLE [dbo].[FactInternetSalesReason] (
[SalesOrderNumber] [nvarchar] (20) NOT NULL,
[SalesOrderLineNumber] [tinyint] NOT NULL,
[SalesReasonKey] [int] NOT NULL
) ON [PRIMARY];
|CREATE_TABLE2010-09-30T11:12:47.55051JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboFactInternetSalesReasonTABLECREATE TABLE [dbo].[FactInternetSalesReason] (
[SalesOrderNumber] [nvarchar] (20) NOT NULL,
[SalesOrderLineNumber] [tinyint] NOT NULL,
[SalesReasonKey] [int] NOT NULL
) ON [PRIMARY];
24|2010-09-30 11:12:47.550000000|dbo|CREATE_TABLE|dbo|FactSalesQuota|CREATE TABLE [dbo].[FactSalesQuota] (
[SalesQuotaKey] [int] IDENTITY(1, 1) NOT NULL,
[EmployeeKey] [int] NOT NULL,
[DateKey] [int] NOT NULL,
[CalendarYear] [smallint] NOT NULL,
[CalendarQuarter] [tinyint] NOT NULL,
[SalesAmountQuota] [money] NOT NULL
) ON [PRIMARY];
|CREATE_TABLE2010-09-30T11:12:47.55051JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboFactSalesQuotaTABLECREATE TABLE [dbo].[FactSalesQuota] (
[SalesQuotaKey] [int] IDENTITY(1, 1) NOT NULL,
[EmployeeKey] [int] NOT NULL,
[DateKey] [int] NOT NULL,
[CalendarYear] [smallint] NOT NULL,
[CalendarQuarter] [tinyint] NOT NULL,
[SalesAmountQuota] [money] NOT NULL
) ON [PRIMARY];
25|2010-09-30 11:12:47.553000000|dbo|CREATE_TABLE|dbo|FactSurveyResponse|CREATE TABLE [dbo].[FactSurveyResponse] (
[SurveyResponseKey] [int] IDENTITY(1, 1) NOT NULL,
[DateKey] [int] NOT NULL,
[CustomerKey] [int] NOT NULL,
[ProductCategoryKey] [int] NOT NULL,
[EnglishProductCategoryName] [nvarchar] (50) NOT NULL,
[ProductSubcategoryKey] [int] NOT NULL,
[EnglishProductSubcategoryName] [nvarchar] (50) NOT NULL,
) ON [PRIMARY];
|CREATE_TABLE2010-09-30T11:12:47.55351JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboFactSurveyResponseTABLECREATE TABLE [dbo].[FactSurveyResponse] (
[SurveyResponseKey] [int] IDENTITY(1, 1) NOT NULL,
[DateKey] [int] NOT NULL,
[CustomerKey] [int] NOT NULL,
[ProductCategoryKey] [int] NOT NULL,
[EnglishProductCategoryName] [nvarchar] (50) NOT NULL,
[ProductSubcategoryKey] [int] NOT NULL,
[EnglishProductSubcategoryName] [nvarchar] (50) NOT NULL,
) ON [PRIMARY];
26|2010-09-30 11:12:47.557000000|dbo|CREATE_TABLE|dbo|ProspectiveBuyer|CREATE TABLE [dbo].[ProspectiveBuyer] (
[ProspectiveBuyerKey] [int] IDENTITY(1, 1) NOT NULL,
[ProspectAlternateKey] [nvarchar] (15) NULL,
[FirstName] [nvarchar] (50) NULL,
[MiddleName] [nvarchar] (50) NULL,
[LastName] [nvarchar] (50) NULL,
[BirthDate] [datetime] NULL,
[MaritalStatus] [nchar] (1) NULL,
[Gender] [nvarchar] (1) NULL,
[EmailAddress] [nvarchar] (50) NULL,
[YearlyIncome] [money] NULL,
[TotalChildren] [tinyint] NULL,
[NumberChildrenAtHome] [tinyint] NULL,
[Education] [nvarchar] (40) NULL,
[Occupation] [nvarchar] (100) NULL,
[HouseOwnerFlag] [nchar] (1) NULL,
[NumberCarsOwned] [tinyint] NULL,
[AddressLine1] [nvarchar] (120) NULL,
[AddressLine2] [nvarchar] (120) NULL,
[City] [nvarchar](30) NULL,
[StateProvinceCode] [nvarchar] (3) NULL,
[PostalCode] [nvarchar](15) NULL,
[Phone] [nvarchar] (20) NULL,
[Salutation] [nvarchar] (8) NULL,
[Unknown] [int] NULL
) ON [PRIMARY];
|CREATE_TABLE2010-09-30T11:12:47.55751JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboProspectiveBuyerTABLECREATE TABLE [dbo].[ProspectiveBuyer] (
[ProspectiveBuyerKey] [int] IDENTITY(1, 1) NOT NULL,
[ProspectAlternateKey] [nvarchar] (15) NULL,
[FirstName] [nvarchar] (50) NULL,
[MiddleName] [nvarchar] (50) NULL,
[LastName] [nvarchar] (50) NULL,
[BirthDate] [datetime] NULL,
[MaritalStatus] [nchar] (1) NULL,
[Gender] [nvarchar] (1) NULL,
[EmailAddress] [nvarchar] (50) NULL,
[YearlyIncome] [money] NULL,
[TotalChildren] [tinyint] NULL,
[NumberChildrenAtHome] [tinyint] NULL,
[Education] [nvarchar] (40) NULL,
[Occupation] [nvarchar] (100) NULL,
[HouseOwnerFlag] [nchar] (1) NULL,
[NumberCarsOwned] [tinyint] NULL,
[AddressLine1] [nvarchar] (120) NULL,
[AddressLine2] [nvarchar] (120) NULL,
[City] [nvarchar](30) NULL,
[StateProvinceCode] [nvarchar] (3) NULL,
[PostalCode] [nvarchar](15) NULL,
[Phone] [nvarchar] (20) NULL,
[Salutation] [nvarchar] (8) NULL,
[Unknown] [int] NULL
) ON [PRIMARY];
27|2010-09-30 11:12:51.037000000|dbo|ALTER_TABLE|dbo|DimAccount|ALTER TABLE [dbo].[DimAccount] WITH CHECK ADD
CONSTRAINT [PK_DimAccount] PRIMARY KEY CLUSTERED
(
[AccountKey]
) ON [PRIMARY];
|ALTER_TABLE2010-09-30T11:12:51.03751JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboDimAccountTABLEPK_DimAccountALTER TABLE [dbo].[DimAccount] WITH CHECK ADD
CONSTRAINT [PK_DimAccount] PRIMARY KEY CLUSTERED
(
[AccountKey]
) ON [PRIMARY];
28|2010-09-30 11:12:51.043000000|dbo|ALTER_TABLE|dbo|DimCurrency|ALTER TABLE [dbo].[DimCurrency] WITH CHECK ADD
CONSTRAINT [PK_DimCurrency_CurrencyKey] PRIMARY KEY CLUSTERED
(
[CurrencyKey]
) ON [PRIMARY];
|ALTER_TABLE2010-09-30T11:12:51.04351JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboDimCurrencyTABLEPK_DimCurrency_CurrencyKeyALTER TABLE [dbo].[DimCurrency] WITH CHECK ADD
CONSTRAINT [PK_DimCurrency_CurrencyKey] PRIMARY KEY CLUSTERED
(
[CurrencyKey]
) ON [PRIMARY];
29|2010-09-30 11:12:51.290000000|dbo|ALTER_TABLE|dbo|DimCustomer|ALTER TABLE [dbo].[DimCustomer] WITH CHECK ADD
CONSTRAINT [PK_DimCustomer_CustomerKey] PRIMARY KEY CLUSTERED
(
[CustomerKey]
) ON [PRIMARY];
|ALTER_TABLE2010-09-30T11:12:51.29051JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboDimCustomerTABLEPK_DimCustomer_CustomerKeyALTER TABLE [dbo].[DimCustomer] WITH CHECK ADD
CONSTRAINT [PK_DimCustomer_CustomerKey] PRIMARY KEY CLUSTERED
(
[CustomerKey]
) ON [PRIMARY];
30|2010-09-30 11:12:51.297000000|dbo|ALTER_TABLE|dbo|DimDepartmentGroup|ALTER TABLE [dbo].[DimDepartmentGroup] WITH CHECK ADD
CONSTRAINT [PK_DimDepartmentGroup] PRIMARY KEY CLUSTERED
(
[DepartmentGroupKey]
) ON [PRIMARY];
|ALTER_TABLE2010-09-30T11:12:51.29351JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboDimDepartmentGroupTABLEPK_DimDepartmentGroupALTER TABLE [dbo].[DimDepartmentGroup] WITH CHECK ADD
CONSTRAINT [PK_DimDepartmentGroup] PRIMARY KEY CLUSTERED
(
[DepartmentGroupKey]
) ON [PRIMARY];
31|2010-09-30 11:12:51.303000000|dbo|ALTER_TABLE|dbo|DimEmployee|ALTER TABLE [dbo].[DimEmployee] WITH CHECK ADD
CONSTRAINT [PK_DimEmployee_EmployeeKey] PRIMARY KEY CLUSTERED
(
[EmployeeKey]
) ON [PRIMARY];
|ALTER_TABLE2010-09-30T11:12:51.30351JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboDimEmployeeTABLEPK_DimEmployee_EmployeeKeyALTER TABLE [dbo].[DimEmployee] WITH CHECK ADD
CONSTRAINT [PK_DimEmployee_EmployeeKey] PRIMARY KEY CLUSTERED
(
[EmployeeKey]
) ON [PRIMARY];
32|2010-09-30 11:12:51.317000000|dbo|ALTER_TABLE|dbo|DimGeography|ALTER TABLE [dbo].[DimGeography] WITH CHECK ADD
CONSTRAINT [PK_DimGeography_GeographyKey] PRIMARY KEY CLUSTERED
(
[GeographyKey]
) ON [PRIMARY];
|ALTER_TABLE2010-09-30T11:12:51.31751JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboDimGeographyTABLEPK_DimGeography_GeographyKeyALTER TABLE [dbo].[DimGeography] WITH CHECK ADD
CONSTRAINT [PK_DimGeography_GeographyKey] PRIMARY KEY CLUSTERED
(
[GeographyKey]
) ON [PRIMARY];
79|2010-09-30 11:12:54.857000000|dbo|CREATE_INDEX|dbo|IX_FactResellerSales_ShipDateKey|CREATE INDEX [IX_FactResellerSales_ShipDateKey] ON [dbo].[FactResellerSales]([ShipDateKey]) ON [PRIMARY];
|CREATE_INDEX2010-09-30T11:12:54.85751JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboIX_FactResellerSales_ShipDateKeyINDEXFactResellerSalesTABLECREATE INDEX [IX_FactResellerSales_ShipDateKey] ON [dbo].[FactResellerSales]([ShipDateKey]) ON [PRIMARY];
33|2010-09-30 11:12:51.320000000|dbo|ALTER_TABLE|dbo|DimOrganization|ALTER TABLE [dbo].[DimOrganization] WITH CHECK ADD
CONSTRAINT [PK_DimOrganization] PRIMARY KEY CLUSTERED
(
[OrganizationKey]
) ON [PRIMARY];
|ALTER_TABLE2010-09-30T11:12:51.32051JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboDimOrganizationTABLEPK_DimOrganizationALTER TABLE [dbo].[DimOrganization] WITH CHECK ADD
CONSTRAINT [PK_DimOrganization] PRIMARY KEY CLUSTERED
(
[OrganizationKey]
) ON [PRIMARY];
34|2010-09-30 11:12:51.357000000|dbo|ALTER_TABLE|dbo|DimProduct|ALTER TABLE [dbo].[DimProduct] WITH CHECK ADD
CONSTRAINT [PK_DimProduct_ProductKey] PRIMARY KEY CLUSTERED
(
[ProductKey]
) ON [PRIMARY];
|ALTER_TABLE2010-09-30T11:12:51.35351JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboDimProductTABLEPK_DimProduct_ProductKeyALTER TABLE [dbo].[DimProduct] WITH CHECK ADD
CONSTRAINT [PK_DimProduct_ProductKey] PRIMARY KEY CLUSTERED
(
[ProductKey]
) ON [PRIMARY];
35|2010-09-30 11:12:51.360000000|dbo|ALTER_TABLE|dbo|DimProductCategory|ALTER TABLE [dbo].[DimProductCategory] WITH CHECK ADD
CONSTRAINT [PK_DimProductCategory_ProductCategoryKey] PRIMARY KEY CLUSTERED
(
[ProductCategoryKey]
) ON [PRIMARY];
|ALTER_TABLE2010-09-30T11:12:51.36051JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboDimProductCategoryTABLEPK_DimProductCategory_ProductCategoryKeyALTER TABLE [dbo].[DimProductCategory] WITH CHECK ADD
CONSTRAINT [PK_DimProductCategory_ProductCategoryKey] PRIMARY KEY CLUSTERED
(
[ProductCategoryKey]
) ON [PRIMARY];
84|2010-09-30 11:12:55.637000000|dbo|CREATE_INDEX|dbo|IX_FactSurveyResponse_DateKey|CREATE INDEX [IX_FactSurveyResponse_DateKey] ON [dbo].[FactSurveyResponse] ([DateKey]) ON [PRIMARY];
|CREATE_INDEX2010-09-30T11:12:55.63751JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboIX_FactSurveyResponse_DateKeyINDEXFactSurveyResponseTABLECREATE INDEX [IX_FactSurveyResponse_DateKey] ON [dbo].[FactSurveyResponse] ([DateKey]) ON [PRIMARY];
36|2010-09-30 11:12:51.367000000|dbo|ALTER_TABLE|dbo|DimProductSubcategory|ALTER TABLE [dbo].[DimProductSubcategory] WITH CHECK ADD
CONSTRAINT [PK_DimProductSubcategory_ProductSubcategoryKey] PRIMARY KEY CLUSTERED
(
[ProductSubcategoryKey]
) ON [PRIMARY];
|ALTER_TABLE2010-09-30T11:12:51.36751JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboDimProductSubcategoryTABLEPK_DimProductSubcategory_ProductSubcategoryKeyALTER TABLE [dbo].[DimProductSubcategory] WITH CHECK ADD
CONSTRAINT [PK_DimProductSubcategory_ProductSubcategoryKey] PRIMARY KEY CLUSTERED
(
[ProductSubcategoryKey]
) ON [PRIMARY];
37|2010-09-30 11:12:51.370000000|dbo|ALTER_TABLE|dbo|DimPromotion|ALTER TABLE [dbo].[DimPromotion] WITH CHECK ADD
CONSTRAINT [PK_DimPromotion_PromotionKey] PRIMARY KEY CLUSTERED
(
[PromotionKey]
) ON [PRIMARY];
|ALTER_TABLE2010-09-30T11:12:51.37051JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboDimPromotionTABLEPK_DimPromotion_PromotionKeyALTER TABLE [dbo].[DimPromotion] WITH CHECK ADD
CONSTRAINT [PK_DimPromotion_PromotionKey] PRIMARY KEY CLUSTERED
(
[PromotionKey]
) ON [PRIMARY];
38|2010-09-30 11:12:51.380000000|dbo|ALTER_TABLE|dbo|DimReseller|ALTER TABLE [dbo].[DimReseller] WITH CHECK ADD
CONSTRAINT [PK_DimReseller_ResellerKey] PRIMARY KEY CLUSTERED
(
[ResellerKey]
) ON [PRIMARY];
|ALTER_TABLE2010-09-30T11:12:51.38051JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboDimResellerTABLEPK_DimReseller_ResellerKeyALTER TABLE [dbo].[DimReseller] WITH CHECK ADD
CONSTRAINT [PK_DimReseller_ResellerKey] PRIMARY KEY CLUSTERED
(
[ResellerKey]
) ON [PRIMARY];
82|2010-09-30 11:12:55.627000000|dbo|CREATE_INDEX|dbo|IX_FactSalesQuota_EmployeeKey|CREATE INDEX [IX_FactSalesQuota_EmployeeKey] ON [dbo].[FactSalesQuota]([EmployeeKey]) ON [PRIMARY];
|CREATE_INDEX2010-09-30T11:12:55.62751JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboIX_FactSalesQuota_EmployeeKeyINDEXFactSalesQuotaTABLECREATE INDEX [IX_FactSalesQuota_EmployeeKey] ON [dbo].[FactSalesQuota]([EmployeeKey]) ON [PRIMARY];
39|2010-09-30 11:12:51.383000000|dbo|ALTER_TABLE|dbo|DimSalesReason|ALTER TABLE [dbo].[DimSalesReason] WITH CHECK ADD
CONSTRAINT [PK_DimSalesReason_SalesReasonKey] PRIMARY KEY CLUSTERED
(
[SalesReasonKey]
) ON [PRIMARY];
|ALTER_TABLE2010-09-30T11:12:51.38351JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboDimSalesReasonTABLEPK_DimSalesReason_SalesReasonKeyALTER TABLE [dbo].[DimSalesReason] WITH CHECK ADD
CONSTRAINT [PK_DimSalesReason_SalesReasonKey] PRIMARY KEY CLUSTERED
(
[SalesReasonKey]
) ON [PRIMARY];
40|2010-09-30 11:12:51.390000000|dbo|ALTER_TABLE|dbo|DimSalesTerritory|ALTER TABLE [dbo].[DimSalesTerritory] WITH CHECK ADD
CONSTRAINT [PK_DimSalesTerritory_SalesTerritoryKey] PRIMARY KEY CLUSTERED
(
[SalesTerritoryKey]
) ON [PRIMARY];
|ALTER_TABLE2010-09-30T11:12:51.39051JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboDimSalesTerritoryTABLEPK_DimSalesTerritory_SalesTerritoryKeyALTER TABLE [dbo].[DimSalesTerritory] WITH CHECK ADD
CONSTRAINT [PK_DimSalesTerritory_SalesTerritoryKey] PRIMARY KEY CLUSTERED
(
[SalesTerritoryKey]
) ON [PRIMARY];
41|2010-09-30 11:12:51.393000000|dbo|ALTER_TABLE|dbo|DimScenario|ALTER TABLE [dbo].[DimScenario] WITH CHECK ADD
CONSTRAINT [PK_DimScenario] PRIMARY KEY CLUSTERED
(
[ScenarioKey]
) ON [PRIMARY];
|ALTER_TABLE2010-09-30T11:12:51.39351JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboDimScenarioTABLEPK_DimScenarioALTER TABLE [dbo].[DimScenario] WITH CHECK ADD
CONSTRAINT [PK_DimScenario] PRIMARY KEY CLUSTERED
(
[ScenarioKey]
) ON [PRIMARY];
42|2010-09-30 11:12:51.403000000|dbo|ALTER_TABLE|dbo|DimDate|ALTER TABLE [dbo].[DimDate] WITH CHECK ADD
CONSTRAINT [PK_DimDate_DateKey] PRIMARY KEY CLUSTERED
(
[DateKey]
) ON [PRIMARY];
|ALTER_TABLE2010-09-30T11:12:51.40351JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboDimDateTABLEPK_DimDate_DateKeyALTER TABLE [dbo].[DimDate] WITH CHECK ADD
CONSTRAINT [PK_DimDate_DateKey] PRIMARY KEY CLUSTERED
(
[DateKey]
) ON [PRIMARY];
43|2010-09-30 11:12:51.410000000|dbo|ALTER_TABLE|dbo|FactCallCenter|ALTER TABLE [dbo].[FactCallCenter] WITH CHECK ADD
CONSTRAINT [PK_FactCallCenter_FactCallCenterID] PRIMARY KEY CLUSTERED
(
[FactCallCenterID]
) ON [PRIMARY];
|ALTER_TABLE2010-09-30T11:12:51.40751JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboFactCallCenterTABLEPK_FactCallCenter_FactCallCenterIDALTER TABLE [dbo].[FactCallCenter] WITH CHECK ADD
CONSTRAINT [PK_FactCallCenter_FactCallCenterID] PRIMARY KEY CLUSTERED
(
[FactCallCenterID]
) ON [PRIMARY];
44|2010-09-30 11:12:51.457000000|dbo|ALTER_TABLE|dbo|FactCurrencyRate|ALTER TABLE [dbo].[FactCurrencyRate] WITH CHECK ADD
CONSTRAINT [PK_FactCurrencyRate_CurrencyKey_DateKey] PRIMARY KEY CLUSTERED
(
[CurrencyKey],
[DateKey]
) ON [PRIMARY];
|ALTER_TABLE2010-09-30T11:12:51.45351JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboFactCurrencyRateTABLEPK_FactCurrencyRate_CurrencyKey_DateKeyALTER TABLE [dbo].[FactCurrencyRate] WITH CHECK ADD
CONSTRAINT [PK_FactCurrencyRate_CurrencyKey_DateKey] PRIMARY KEY CLUSTERED
(
[CurrencyKey],
[DateKey]
) ON [PRIMARY];
45|2010-09-30 11:12:51.937000000|dbo|ALTER_TABLE|dbo|FactInternetSales|ALTER TABLE [dbo].[FactInternetSales] ADD
CONSTRAINT [PK_FactInternetSales_SalesOrderNumber_SalesOrderLineNumber] PRIMARY KEY CLUSTERED
(
[SalesOrderNumber],
[SalesOrderLineNumber]
) ON [PRIMARY];
|ALTER_TABLE2010-09-30T11:12:51.93351JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboFactInternetSalesTABLEPK_FactInternetSales_SalesOrderNumber_SalesOrderLineNumberALTER TABLE [dbo].[FactInternetSales] ADD
CONSTRAINT [PK_FactInternetSales_SalesOrderNumber_SalesOrderLineNumber] PRIMARY KEY CLUSTERED
(
[SalesOrderNumber],
[SalesOrderLineNumber]
) ON [PRIMARY];
46|2010-09-30 11:12:52.437000000|dbo|ALTER_TABLE|dbo|FactResellerSales|ALTER TABLE [dbo].[FactResellerSales] ADD
CONSTRAINT [PK_FactResellerSales_SalesOrderNumber_SalesOrderLineNumber] PRIMARY KEY CLUSTERED
(
[SalesOrderNumber],
[SalesOrderLineNumber]
) ON [PRIMARY];
|ALTER_TABLE2010-09-30T11:12:52.43751JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboFactResellerSalesTABLEPK_FactResellerSales_SalesOrderNumber_SalesOrderLineNumberALTER TABLE [dbo].[FactResellerSales] ADD
CONSTRAINT [PK_FactResellerSales_SalesOrderNumber_SalesOrderLineNumber] PRIMARY KEY CLUSTERED
(
[SalesOrderNumber],
[SalesOrderLineNumber]
) ON [PRIMARY];
47|2010-09-30 11:12:52.603000000|dbo|ALTER_TABLE|dbo|FactInternetSalesReason|ALTER TABLE [dbo].[FactInternetSalesReason] ADD
CONSTRAINT [PK_FactInternetSalesReason_SalesOrderNumber_SalesOrderLineNumber_SalesReasonKey] PRIMARY KEY CLUSTERED
(
[SalesOrderNumber],
[SalesOrderLineNumber],
[SalesReasonKey]
) ON [PRIMARY];
|ALTER_TABLE2010-09-30T11:12:52.60351JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboFactInternetSalesReasonTABLEPK_FactInternetSalesReason_SalesOrderNumber_SalesOrderLineNumber_SalesReasonKeyALTER TABLE [dbo].[FactInternetSalesReason] ADD
CONSTRAINT [PK_FactInternetSalesReason_SalesOrderNumber_SalesOrderLineNumber_SalesReasonKey] PRIMARY KEY CLUSTERED
(
[SalesOrderNumber],
[SalesOrderLineNumber],
[SalesReasonKey]
) ON [PRIMARY];
48|2010-09-30 11:12:52.610000000|dbo|ALTER_TABLE|dbo|FactSalesQuota|ALTER TABLE [dbo].[FactSalesQuota] ADD
CONSTRAINT [PK_FactSalesQuota_SalesQuotaKey] PRIMARY KEY CLUSTERED
(
[SalesQuotaKey]
) ON [PRIMARY];
|ALTER_TABLE2010-09-30T11:12:52.61051JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboFactSalesQuotaTABLEPK_FactSalesQuota_SalesQuotaKeyALTER TABLE [dbo].[FactSalesQuota] ADD
CONSTRAINT [PK_FactSalesQuota_SalesQuotaKey] PRIMARY KEY CLUSTERED
(
[SalesQuotaKey]
) ON [PRIMARY];
63|2010-09-30 11:12:52.780000000|dbo|CREATE_INDEX|dbo|IX_DimReseller_GeographyKey|CREATE INDEX [IX_DimReseller_GeographyKey] ON [dbo].[DimReseller]([GeographyKey]) ON [PRIMARY];
|CREATE_INDEX2010-09-30T11:12:52.78051JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboIX_DimReseller_GeographyKeyINDEXDimResellerTABLECREATE INDEX [IX_DimReseller_GeographyKey] ON [dbo].[DimReseller]([GeographyKey]) ON [PRIMARY];
67|2010-09-30 11:12:52.913000000|dbo|CREATE_INDEX|dbo|IX_FactInternetSales_CurrencyKey|CREATE INDEX [IX_FactInternetSales_CurrencyKey] ON [dbo].[FactInternetSales]([CurrencyKey]) ON [PRIMARY];
|CREATE_INDEX2010-09-30T11:12:52.91351JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboIX_FactInternetSales_CurrencyKeyINDEXFactInternetSalesTABLECREATE INDEX [IX_FactInternetSales_CurrencyKey] ON [dbo].[FactInternetSales]([CurrencyKey]) ON [PRIMARY];
49|2010-09-30 11:12:52.620000000|dbo|ALTER_TABLE|dbo|FactSurveyResponse|ALTER TABLE [dbo].[FactSurveyResponse] ADD
CONSTRAINT [PK_FactSurveyResponse_SurveyResponseKey] PRIMARY KEY CLUSTERED
(
[SurveyResponseKey]
) ON [PRIMARY];
|ALTER_TABLE2010-09-30T11:12:52.62051JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboFactSurveyResponseTABLEPK_FactSurveyResponse_SurveyResponseKeyALTER TABLE [dbo].[FactSurveyResponse] ADD
CONSTRAINT [PK_FactSurveyResponse_SurveyResponseKey] PRIMARY KEY CLUSTERED
(
[SurveyResponseKey]
) ON [PRIMARY];
50|2010-09-30 11:12:52.637000000|dbo|ALTER_TABLE|dbo|ProspectiveBuyer|ALTER TABLE [dbo].[ProspectiveBuyer] ADD
CONSTRAINT [PK_ProspectiveBuyer_ProspectiveBuyerKey] PRIMARY KEY CLUSTERED
(
[ProspectiveBuyerKey]
) ON [PRIMARY];
|ALTER_TABLE2010-09-30T11:12:52.63751JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboProspectiveBuyerTABLEPK_ProspectiveBuyer_ProspectiveBuyerKeyALTER TABLE [dbo].[ProspectiveBuyer] ADD
CONSTRAINT [PK_ProspectiveBuyer_ProspectiveBuyerKey] PRIMARY KEY CLUSTERED
(
[ProspectiveBuyerKey]
) ON [PRIMARY];
51|2010-09-30 11:12:52.667000000|dbo|CREATE_INDEX|dbo|AK_DimAccount_AccountCodeAlternateKey|CREATE UNIQUE INDEX [AK_DimAccount_AccountCodeAlternateKey] ON [dbo].[DimAccount]([AccountCodeAlternateKey]) ON [PRIMARY];
|CREATE_INDEX2010-09-30T11:12:52.66751JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboAK_DimAccount_AccountCodeAlternateKeyINDEXDimAccountTABLECREATE UNIQUE INDEX [AK_DimAccount_AccountCodeAlternateKey] ON [dbo].[DimAccount]([AccountCodeAlternateKey]) ON [PRIMARY];
52|2010-09-30 11:12:52.670000000|dbo|ALTER_TABLE|dbo|DimCurrency|ALTER TABLE [dbo].[DimCurrency] ADD
CONSTRAINT [AK_DimCurrency_CurrencyAlternateKey] UNIQUE NONCLUSTERED
(
[CurrencyAlternateKey]
) ON [PRIMARY];
|ALTER_TABLE2010-09-30T11:12:52.67051JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboDimCurrencyTABLEAK_DimCurrency_CurrencyAlternateKeyALTER TABLE [dbo].[DimCurrency] ADD
CONSTRAINT [AK_DimCurrency_CurrencyAlternateKey] UNIQUE NONCLUSTERED
(
[CurrencyAlternateKey]
) ON [PRIMARY];
53|2010-09-30 11:12:52.710000000|dbo|ALTER_TABLE|dbo|DimCustomer|ALTER TABLE [dbo].[DimCustomer] ADD
CONSTRAINT [IX_DimCustomer_CustomerAlternateKey] UNIQUE NONCLUSTERED
(
[CustomerAlternateKey]
) ON [PRIMARY];
|ALTER_TABLE2010-09-30T11:12:52.71051JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboDimCustomerTABLEIX_DimCustomer_CustomerAlternateKeyALTER TABLE [dbo].[DimCustomer] ADD
CONSTRAINT [IX_DimCustomer_CustomerAlternateKey] UNIQUE NONCLUSTERED
(
[CustomerAlternateKey]
) ON [PRIMARY];
54|2010-09-30 11:12:52.737000000|dbo|CREATE_INDEX|dbo|IX_DimCustomer_GeographyKey|CREATE INDEX [IX_DimCustomer_GeographyKey] ON [dbo].[DimCustomer]([GeographyKey]) ON [PRIMARY];
|CREATE_INDEX2010-09-30T11:12:52.73751JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboIX_DimCustomer_GeographyKeyINDEXDimCustomerTABLECREATE INDEX [IX_DimCustomer_GeographyKey] ON [dbo].[DimCustomer]([GeographyKey]) ON [PRIMARY];
55|2010-09-30 11:12:52.740000000|dbo|CREATE_INDEX|dbo|IX_DimEmployee_ParentEmployeeKey|CREATE INDEX [IX_DimEmployee_ParentEmployeeKey] ON [dbo].[DimEmployee]([ParentEmployeeKey]) ON [PRIMARY];
|CREATE_INDEX2010-09-30T11:12:52.74051JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboIX_DimEmployee_ParentEmployeeKeyINDEXDimEmployeeTABLECREATE INDEX [IX_DimEmployee_ParentEmployeeKey] ON [dbo].[DimEmployee]([ParentEmployeeKey]) ON [PRIMARY];
57|2010-09-30 11:12:52.750000000|dbo|ALTER_TABLE|dbo|DimProduct|ALTER TABLE [dbo].[DimProduct] ADD
CONSTRAINT [AK_DimProduct_ProductAlternateKey_StartDate] UNIQUE NONCLUSTERED
(
[ProductAlternateKey],
[StartDate]
) ON [PRIMARY];
|ALTER_TABLE2010-09-30T11:12:52.75051JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboDimProductTABLEAK_DimProduct_ProductAlternateKey_StartDateALTER TABLE [dbo].[DimProduct] ADD
CONSTRAINT [AK_DimProduct_ProductAlternateKey_StartDate] UNIQUE NONCLUSTERED
(
[ProductAlternateKey],
[StartDate]
) ON [PRIMARY];
58|2010-09-30 11:12:52.757000000|dbo|CREATE_INDEX|dbo|IX_DimProduct_ProductSubcategoryKey|CREATE INDEX [IX_DimProduct_ProductSubcategoryKey] ON [dbo].[DimProduct]([ProductSubcategoryKey]) ON [PRIMARY];
|CREATE_INDEX2010-09-30T11:12:52.75751JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboIX_DimProduct_ProductSubcategoryKeyINDEXDimProductTABLECREATE INDEX [IX_DimProduct_ProductSubcategoryKey] ON [dbo].[DimProduct]([ProductSubcategoryKey]) ON [PRIMARY];
59|2010-09-30 11:12:52.760000000|dbo|ALTER_TABLE|dbo|DimProductCategory|ALTER TABLE [dbo].[DimProductCategory] ADD
CONSTRAINT [AK_DimProductCategory_ProductCategoryAlternateKey] UNIQUE NONCLUSTERED
(
[ProductCategoryAlternateKey]
) ON [PRIMARY];
|ALTER_TABLE2010-09-30T11:12:52.76051JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboDimProductCategoryTABLEAK_DimProductCategory_ProductCategoryAlternateKeyALTER TABLE [dbo].[DimProductCategory] ADD
CONSTRAINT [AK_DimProductCategory_ProductCategoryAlternateKey] UNIQUE NONCLUSTERED
(
[ProductCategoryAlternateKey]
) ON [PRIMARY];
69|2010-09-30 11:12:53.127000000|dbo|CREATE_INDEX|dbo|IX_FactInternetSales_DueDateKey|CREATE INDEX [IX_FactInternetSales_DueDateKey] ON [dbo].[FactInternetSales]([DueDateKey]) ON [PRIMARY];
|CREATE_INDEX2010-09-30T11:12:53.12751JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboIX_FactInternetSales_DueDateKeyINDEXFactInternetSalesTABLECREATE INDEX [IX_FactInternetSales_DueDateKey] ON [dbo].[FactInternetSales]([DueDateKey]) ON [PRIMARY];
60|2010-09-30 11:12:52.763000000|dbo|ALTER_TABLE|dbo|DimProductSubcategory|ALTER TABLE [dbo].[DimProductSubcategory] ADD
CONSTRAINT [AK_DimProductSubcategory_ProductSubcategoryAlternateKey] UNIQUE NONCLUSTERED
(
[ProductSubcategoryAlternateKey]
) ON [PRIMARY];
|ALTER_TABLE2010-09-30T11:12:52.76351JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboDimProductSubcategoryTABLEAK_DimProductSubcategory_ProductSubcategoryAlternateKeyALTER TABLE [dbo].[DimProductSubcategory] ADD
CONSTRAINT [AK_DimProductSubcategory_ProductSubcategoryAlternateKey] UNIQUE NONCLUSTERED
(
[ProductSubcategoryAlternateKey]
) ON [PRIMARY];
61|2010-09-30 11:12:52.767000000|dbo|ALTER_TABLE|dbo|DimPromotion|ALTER TABLE [dbo].[DimPromotion] ADD
CONSTRAINT [AK_DimPromotion_PromotionAlternateKey] UNIQUE NONCLUSTERED
(
[PromotionAlternateKey]
) ON [PRIMARY];
|ALTER_TABLE2010-09-30T11:12:52.76751JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboDimPromotionTABLEAK_DimPromotion_PromotionAlternateKeyALTER TABLE [dbo].[DimPromotion] ADD
CONSTRAINT [AK_DimPromotion_PromotionAlternateKey] UNIQUE NONCLUSTERED
(
[PromotionAlternateKey]
) ON [PRIMARY];
62|2010-09-30 11:12:52.773000000|dbo|ALTER_TABLE|dbo|DimReseller|ALTER TABLE [dbo].[DimReseller] ADD
CONSTRAINT [AK_DimReseller_ResellerAlternateKey] UNIQUE NONCLUSTERED
(
[ResellerAlternateKey]
) ON [PRIMARY];
|ALTER_TABLE2010-09-30T11:12:52.77351JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboDimResellerTABLEAK_DimReseller_ResellerAlternateKeyALTER TABLE [dbo].[DimReseller] ADD
CONSTRAINT [AK_DimReseller_ResellerAlternateKey] UNIQUE NONCLUSTERED
(
[ResellerAlternateKey]
) ON [PRIMARY];
64|2010-09-30 11:12:52.780000000|dbo|ALTER_TABLE|dbo|DimSalesTerritory|ALTER TABLE [dbo].[DimSalesTerritory] ADD
CONSTRAINT [AK_DimSalesTerritory_SalesTerritoryAlternateKey] UNIQUE NONCLUSTERED
(
[SalesTerritoryAlternateKey]
) ON [PRIMARY];
|ALTER_TABLE2010-09-30T11:12:52.78051JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboDimSalesTerritoryTABLEAK_DimSalesTerritory_SalesTerritoryAlternateKeyALTER TABLE [dbo].[DimSalesTerritory] ADD
CONSTRAINT [AK_DimSalesTerritory_SalesTerritoryAlternateKey] UNIQUE NONCLUSTERED
(
[SalesTerritoryAlternateKey]
) ON [PRIMARY];
65|2010-09-30 11:12:52.787000000|dbo|ALTER_TABLE|dbo|DimDate|ALTER TABLE [dbo].[DimDate] ADD
CONSTRAINT [AK_DimDate_FullDateAlternateKey] UNIQUE NONCLUSTERED
(
[FullDateAlternateKey]
) ON [PRIMARY];
|ALTER_TABLE2010-09-30T11:12:52.78751JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboDimDateTABLEAK_DimDate_FullDateAlternateKeyALTER TABLE [dbo].[DimDate] ADD
CONSTRAINT [AK_DimDate_FullDateAlternateKey] UNIQUE NONCLUSTERED
(
[FullDateAlternateKey]
) ON [PRIMARY];
66|2010-09-30 11:12:52.790000000|dbo|ALTER_TABLE|dbo|FactCallCenter|ALTER TABLE [dbo].[FactCallCenter] ADD
CONSTRAINT [AK_FactCallCenter_DateKey_Shift] UNIQUE NONCLUSTERED
(
[DateKey],
[Shift]
) ON [PRIMARY];
|ALTER_TABLE2010-09-30T11:12:52.79051JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboFactCallCenterTABLEAK_FactCallCenter_DateKey_ShiftALTER TABLE [dbo].[FactCallCenter] ADD
CONSTRAINT [AK_FactCallCenter_DateKey_Shift] UNIQUE NONCLUSTERED
(
[DateKey],
[Shift]
) ON [PRIMARY];
71|2010-09-30 11:12:53.413000000|dbo|CREATE_INDEX|dbo|IX_FactInternetSales_ProductKey|CREATE INDEX [IX_FactInternetSales_ProductKey] ON [dbo].[FactInternetSales]([ProductKey]) ON [PRIMARY];
|CREATE_INDEX2010-09-30T11:12:53.41051JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboIX_FactInternetSales_ProductKeyINDEXFactInternetSalesTABLECREATE INDEX [IX_FactInternetSales_ProductKey] ON [dbo].[FactInternetSales]([ProductKey]) ON [PRIMARY];
73|2010-09-30 11:12:53.720000000|dbo|CREATE_INDEX|dbo|IX_FactIneternetSales_ShipDateKey|CREATE INDEX [IX_FactIneternetSales_ShipDateKey] ON [dbo].[FactInternetSales]([ShipDateKey]) ON [PRIMARY];
|CREATE_INDEX2010-09-30T11:12:53.72051JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboIX_FactIneternetSales_ShipDateKeyINDEXFactInternetSalesTABLECREATE INDEX [IX_FactIneternetSales_ShipDateKey] ON [dbo].[FactInternetSales]([ShipDateKey]) ON [PRIMARY];
74|2010-09-30 11:12:53.870000000|dbo|CREATE_INDEX|dbo|IX_FactResellerSales_CurrencyKey|CREATE INDEX [IX_FactResellerSales_CurrencyKey] ON [dbo].[FactResellerSales]([CurrencyKey]) ON [PRIMARY];
|CREATE_INDEX2010-09-30T11:12:53.87051JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboIX_FactResellerSales_CurrencyKeyINDEXFactResellerSalesTABLECREATE INDEX [IX_FactResellerSales_CurrencyKey] ON [dbo].[FactResellerSales]([CurrencyKey]) ON [PRIMARY];
75|2010-09-30 11:12:53.987000000|dbo|CREATE_INDEX|dbo|IX_FactResellerSales_DueDateKey|CREATE INDEX [IX_FactResellerSales_DueDateKey] ON [dbo].[FactResellerSales]([DueDateKey]) ON [PRIMARY];
|CREATE_INDEX2010-09-30T11:12:53.98351JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboIX_FactResellerSales_DueDateKeyINDEXFactResellerSalesTABLECREATE INDEX [IX_FactResellerSales_DueDateKey] ON [dbo].[FactResellerSales]([DueDateKey]) ON [PRIMARY];
76|2010-09-30 11:12:54.100000000|dbo|CREATE_INDEX|dbo|IX_FactResellerSales_OrderDateKey|CREATE INDEX [IX_FactResellerSales_OrderDateKey] ON [dbo].[FactResellerSales]([OrderDateKey]) ON [PRIMARY];
|CREATE_INDEX2010-09-30T11:12:54.10051JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboIX_FactResellerSales_OrderDateKeyINDEXFactResellerSalesTABLECREATE INDEX [IX_FactResellerSales_OrderDateKey] ON [dbo].[FactResellerSales]([OrderDateKey]) ON [PRIMARY];
77|2010-09-30 11:12:54.253000000|dbo|CREATE_INDEX|dbo|IX_FactResellerSales_ProductKey|CREATE INDEX [IX_FactResellerSales_ProductKey] ON [dbo].[FactResellerSales]([ProductKey]) ON [PRIMARY];
|CREATE_INDEX2010-09-30T11:12:54.25351JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboIX_FactResellerSales_ProductKeyINDEXFactResellerSalesTABLECREATE INDEX [IX_FactResellerSales_ProductKey] ON [dbo].[FactResellerSales]([ProductKey]) ON [PRIMARY];
81|2010-09-30 11:12:55.623000000|dbo|CREATE_INDEX|dbo|IX_FactResellerSales_ResellerKey|CREATE INDEX [IX_FactResellerSales_ResellerKey] ON [dbo].[FactResellerSales]([ResellerKey]) ON [PRIMARY];
|CREATE_INDEX2010-09-30T11:12:55.62351JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboIX_FactResellerSales_ResellerKeyINDEXFactResellerSalesTABLECREATE INDEX [IX_FactResellerSales_ResellerKey] ON [dbo].[FactResellerSales]([ResellerKey]) ON [PRIMARY];
86|2010-09-30 11:12:55.650000000|dbo|CREATE_INDEX|dbo|IX_FactSurveyResponse_ProductSubcategoryKey|CREATE INDEX [IX_FactSurveyResponse_ProductSubcategoryKey] ON [dbo].[FactSurveyResponse] ([ProductSubcategoryKey]) ON [PRIMARY];
|CREATE_INDEX2010-09-30T11:12:55.65051JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboIX_FactSurveyResponse_ProductSubcategoryKeyINDEXFactSurveyResponseTABLECREATE INDEX [IX_FactSurveyResponse_ProductSubcategoryKey] ON [dbo].[FactSurveyResponse] ([ProductSubcategoryKey]) ON [PRIMARY];
87|2010-09-30 11:12:55.660000000|dbo|CREATE_INDEX|dbo|IX_ProspectiveBuyer_ProspectAlternateKey|CREATE INDEX [IX_ProspectiveBuyer_ProspectAlternateKey] ON [dbo].[ProspectiveBuyer]([ProspectAlternateKey]) ON [PRIMARY];
|CREATE_INDEX2010-09-30T11:12:55.66051JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboIX_ProspectiveBuyer_ProspectAlternateKeyINDEXProspectiveBuyerTABLECREATE INDEX [IX_ProspectiveBuyer_ProspectAlternateKey] ON [dbo].[ProspectiveBuyer]([ProspectAlternateKey]) ON [PRIMARY];
88|2010-09-30 11:12:55.683000000|dbo|ALTER_TABLE|dbo|DimAccount|ALTER TABLE [dbo].[DimAccount] ADD
CONSTRAINT [FK_DimAccount_DimAccount] FOREIGN KEY
(
[ParentAccountKey]
) REFERENCES [dbo].[DimAccount] (
[AccountKey]
);
|ALTER_TABLE2010-09-30T11:12:55.68351JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboDimAccountTABLEFK_DimAccount_DimAccountALTER TABLE [dbo].[DimAccount] ADD
CONSTRAINT [FK_DimAccount_DimAccount] FOREIGN KEY
(
[ParentAccountKey]
) REFERENCES [dbo].[DimAccount] (
[AccountKey]
);
89|2010-09-30 11:12:55.697000000|dbo|ALTER_TABLE|dbo|DimCustomer|ALTER TABLE [dbo].[DimCustomer] ADD
CONSTRAINT [FK_DimCustomer_DimGeography] FOREIGN KEY
(
[GeographyKey]
) REFERENCES [dbo].[DimGeography] (
[GeographyKey]
);
|ALTER_TABLE2010-09-30T11:12:55.69351JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboDimCustomerTABLEFK_DimCustomer_DimGeographyALTER TABLE [dbo].[DimCustomer] ADD
CONSTRAINT [FK_DimCustomer_DimGeography] FOREIGN KEY
(
[GeographyKey]
) REFERENCES [dbo].[DimGeography] (
[GeographyKey]
);
90|2010-09-30 11:12:55.700000000|dbo|ALTER_TABLE|dbo|DimDepartmentGroup|ALTER TABLE [dbo].[DimDepartmentGroup] ADD
CONSTRAINT [FK_DimDepartmentGroup_DimDepartmentGroup] FOREIGN KEY
(
[ParentDepartmentGroupKey]
) REFERENCES [dbo].[DimDepartmentGroup] (
[DepartmentGroupKey]
);
|ALTER_TABLE2010-09-30T11:12:55.70051JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboDimDepartmentGroupTABLEFK_DimDepartmentGroup_DimDepartmentGroupALTER TABLE [dbo].[DimDepartmentGroup] ADD
CONSTRAINT [FK_DimDepartmentGroup_DimDepartmentGroup] FOREIGN KEY
(
[ParentDepartmentGroupKey]
) REFERENCES [dbo].[DimDepartmentGroup] (
[DepartmentGroupKey]
);
91|2010-09-30 11:12:55.707000000|dbo|ALTER_TABLE|dbo|DimEmployee|ALTER TABLE [dbo].[DimEmployee] ADD
CONSTRAINT [FK_DimEmployee_DimEmployee] FOREIGN KEY
(
[ParentEmployeeKey]
) REFERENCES [dbo].[DimEmployee] (
[EmployeeKey]
),
CONSTRAINT [FK_DimEmployee_DimSalesTerritory] FOREIGN KEY
(
[SalesTerritoryKey]
) REFERENCES [dbo].[DimSalesTerritory] (
[SalesTerritoryKey]
);
|ALTER_TABLE2010-09-30T11:12:55.70751JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboDimEmployeeTABLEFK_DimEmployee_DimEmployeeFK_DimEmployee_DimSalesTerritoryALTER TABLE [dbo].[DimEmployee] ADD
CONSTRAINT [FK_DimEmployee_DimEmployee] FOREIGN KEY
(
[ParentEmployeeKey]
) REFERENCES [dbo].[DimEmployee] (
[EmployeeKey]
),
CONSTRAINT [FK_DimEmployee_DimSalesTerritory] FOREIGN KEY
(
[SalesTerritoryKey]
) REFERENCES [dbo].[DimSalesTerritory] (
[SalesTerritoryKey]
);
92|2010-09-30 11:12:55.710000000|dbo|ALTER_TABLE|dbo|DimGeography|ALTER TABLE [dbo].[DimGeography] ADD
CONSTRAINT [FK_DimGeography_DimSalesTerritory] FOREIGN KEY
(
[SalesTerritoryKey]
) REFERENCES [dbo].[DimSalesTerritory] (
[SalesTerritoryKey]
);
|ALTER_TABLE2010-09-30T11:12:55.71051JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboDimGeographyTABLEFK_DimGeography_DimSalesTerritoryALTER TABLE [dbo].[DimGeography] ADD
CONSTRAINT [FK_DimGeography_DimSalesTerritory] FOREIGN KEY
(
[SalesTerritoryKey]
) REFERENCES [dbo].[DimSalesTerritory] (
[SalesTerritoryKey]
);
93|2010-09-30 11:12:55.717000000|dbo|ALTER_TABLE|dbo|DimOrganization|ALTER TABLE [dbo].[DimOrganization] ADD
CONSTRAINT [FK_DimOrganization_DimOrganization] FOREIGN KEY
(
[ParentOrganizationKey]
) REFERENCES [dbo].[DimOrganization] (
[OrganizationKey]
),
CONSTRAINT [FK_DimOrganization_DimCurrency] FOREIGN KEY
(
[CurrencyKey]
) REFERENCES [dbo].[DimCurrency] (
[CurrencyKey]
);
|ALTER_TABLE2010-09-30T11:12:55.71751JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboDimOrganizationTABLEFK_DimOrganization_DimOrganizationFK_DimOrganization_DimCurrencyALTER TABLE [dbo].[DimOrganization] ADD
CONSTRAINT [FK_DimOrganization_DimOrganization] FOREIGN KEY
(
[ParentOrganizationKey]
) REFERENCES [dbo].[DimOrganization] (
[OrganizationKey]
),
CONSTRAINT [FK_DimOrganization_DimCurrency] FOREIGN KEY
(
[CurrencyKey]
) REFERENCES [dbo].[DimCurrency] (
[CurrencyKey]
);
94|2010-09-30 11:12:55.720000000|dbo|ALTER_TABLE|dbo|DimProduct|ALTER TABLE [dbo].[DimProduct] ADD
CONSTRAINT [FK_DimProduct_DimProductSubcategory] FOREIGN KEY
(
[ProductSubcategoryKey]
) REFERENCES [dbo].[DimProductSubcategory] (
[ProductSubcategoryKey]
);
|ALTER_TABLE2010-09-30T11:12:55.72051JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboDimProductTABLEFK_DimProduct_DimProductSubcategoryALTER TABLE [dbo].[DimProduct] ADD
CONSTRAINT [FK_DimProduct_DimProductSubcategory] FOREIGN KEY
(
[ProductSubcategoryKey]
) REFERENCES [dbo].[DimProductSubcategory] (
[ProductSubcategoryKey]
);
95|2010-09-30 11:12:55.727000000|dbo|ALTER_TABLE|dbo|DimProductSubcategory|ALTER TABLE [dbo].[DimProductSubcategory] ADD
CONSTRAINT [FK_DimProductSubcategory_DimProductCategory] FOREIGN KEY
(
[ProductCategoryKey]
) REFERENCES [dbo].[DimProductCategory] (
[ProductCategoryKey]
);
|ALTER_TABLE2010-09-30T11:12:55.72351JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboDimProductSubcategoryTABLEFK_DimProductSubcategory_DimProductCategoryALTER TABLE [dbo].[DimProductSubcategory] ADD
CONSTRAINT [FK_DimProductSubcategory_DimProductCategory] FOREIGN KEY
(
[ProductCategoryKey]
) REFERENCES [dbo].[DimProductCategory] (
[ProductCategoryKey]
);
96|2010-09-30 11:12:55.733000000|dbo|ALTER_TABLE|dbo|DimReseller|ALTER TABLE [dbo].[DimReseller] ADD
CONSTRAINT [FK_DimReseller_DimGeography] FOREIGN KEY
(
[GeographyKey]
) REFERENCES [dbo].[DimGeography] (
[GeographyKey]
);
|ALTER_TABLE2010-09-30T11:12:55.73351JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboDimResellerTABLEFK_DimReseller_DimGeographyALTER TABLE [dbo].[DimReseller] ADD
CONSTRAINT [FK_DimReseller_DimGeography] FOREIGN KEY
(
[GeographyKey]
) REFERENCES [dbo].[DimGeography] (
[GeographyKey]
);
97|2010-09-30 11:12:55.737000000|dbo|ALTER_TABLE|dbo|FactCallCenter|ALTER TABLE [dbo].[FactCallCenter] ADD
CONSTRAINT [FK_FactCallCenter_DimDate] FOREIGN KEY
(
[DateKey]
) REFERENCES [dbo].[DimDate] (
[DateKey]
);
|ALTER_TABLE2010-09-30T11:12:55.73751JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboFactCallCenterTABLEFK_FactCallCenter_DimDateALTER TABLE [dbo].[FactCallCenter] ADD
CONSTRAINT [FK_FactCallCenter_DimDate] FOREIGN KEY
(
[DateKey]
) REFERENCES [dbo].[DimDate] (
[DateKey]
);
98|2010-09-30 11:12:55.773000000|dbo|ALTER_TABLE|dbo|FactCurrencyRate|ALTER TABLE [dbo].[FactCurrencyRate] ADD
CONSTRAINT [FK_FactCurrencyRate_DimDate] FOREIGN KEY
(
[DateKey]
) REFERENCES [dbo].[DimDate] (
[DateKey]
),
CONSTRAINT [FK_FactCurrencyRate_DimCurrency] FOREIGN KEY
(
[CurrencyKey]
) REFERENCES [dbo].[DimCurrency] (
[CurrencyKey]
);
|ALTER_TABLE2010-09-30T11:12:55.77351JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboFactCurrencyRateTABLEFK_FactCurrencyRate_DimDateFK_FactCurrencyRate_DimCurrencyALTER TABLE [dbo].[FactCurrencyRate] ADD
CONSTRAINT [FK_FactCurrencyRate_DimDate] FOREIGN KEY
(
[DateKey]
) REFERENCES [dbo].[DimDate] (
[DateKey]
),
CONSTRAINT [FK_FactCurrencyRate_DimCurrency] FOREIGN KEY
(
[CurrencyKey]
) REFERENCES [dbo].[DimCurrency] (
[CurrencyKey]
);
99|2010-09-30 11:12:55.983000000|dbo|ALTER_TABLE|dbo|FactFinance|ALTER TABLE [dbo].[FactFinance] ADD
CONSTRAINT [FK_FactFinance_DimAccount] FOREIGN KEY
(
[AccountKey]
) REFERENCES [dbo].[DimAccount] (
[AccountKey]
),
CONSTRAINT [FK_FactFinance_DimDepartmentGroup] FOREIGN KEY
(
[DepartmentGroupKey]
) REFERENCES [dbo].[DimDepartmentGroup] (
[DepartmentGroupKey]
),
CONSTRAINT [FK_FactFinance_DimOrganization] FOREIGN KEY
(
[OrganizationKey]
) REFERENCES [dbo].[DimOrganization] (
[OrganizationKey]
),
CONSTRAINT [FK_FactFinance_DimScenario] FOREIGN KEY
(
[ScenarioKey]
) REFERENCES [dbo].[DimScenario] (
[ScenarioKey]
),
CONSTRAINT [FK_FactFinance_DimDate] FOREIGN KEY
(
[DateKey]
) REFERENCES [dbo].[DimDate] (
[DateKey]
);
|ALTER_TABLE2010-09-30T11:12:55.98351JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboFactFinanceTABLEFK_FactFinance_DimAccountFK_FactFinance_DimDepartmentGroupFK_FactFinance_DimOrganizationFK_FactFinance_DimScenarioFK_FactFinance_DimDateALTER TABLE [dbo].[FactFinance] ADD
CONSTRAINT [FK_FactFinance_DimAccount] FOREIGN KEY
(
[AccountKey]
) REFERENCES [dbo].[DimAccount] (
[AccountKey]
),
CONSTRAINT [FK_FactFinance_DimDepartmentGroup] FOREIGN KEY
(
[DepartmentGroupKey]
) REFERENCES [dbo].[DimDepartmentGroup] (
[DepartmentGroupKey]
),
CONSTRAINT [FK_FactFinance_DimOrganization] FOREIGN KEY
(
[OrganizationKey]
) REFERENCES [dbo].[DimOrganization] (
[OrganizationKey]
),
CONSTRAINT [FK_FactFinance_DimScenario] FOREIGN KEY
(
[ScenarioKey]
) REFERENCES [dbo].[DimScenario] (
[ScenarioKey]
),
CONSTRAINT [FK_FactFinance_DimDate] FOREIGN KEY
(
[DateKey]
) REFERENCES [dbo].[DimDate] (
[DateKey]
);
100|2010-09-30 11:12:56.313000000|dbo|ALTER_TABLE|dbo|FactInternetSalesReason|ALTER TABLE [dbo].[FactInternetSalesReason] ADD
CONSTRAINT [FK_FactInternetSalesReason_DimSalesReason] FOREIGN KEY
(
[SalesReasonKey]
) REFERENCES [dbo].[DimSalesReason] (
[SalesReasonKey]
),
CONSTRAINT [FK_FactInternetSalesReason_FactInternetSales] FOREIGN KEY
(
[SalesOrderNumber],
[SalesOrderLineNumber]
) REFERENCES [dbo].[FactInternetSales] (
[SalesOrderNumber],
[SalesOrderLineNumber]
);
|ALTER_TABLE2010-09-30T11:12:56.31351JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboFactInternetSalesReasonTABLEFK_FactInternetSalesReason_DimSalesReasonFK_FactInternetSalesReason_FactInternetSalesALTER TABLE [dbo].[FactInternetSalesReason] ADD
CONSTRAINT [FK_FactInternetSalesReason_DimSalesReason] FOREIGN KEY
(
[SalesReasonKey]
) REFERENCES [dbo].[DimSalesReason] (
[SalesReasonKey]
),
CONSTRAINT [FK_FactInternetSalesReason_FactInternetSales] FOREIGN KEY
(
[SalesOrderNumber],
[SalesOrderLineNumber]
) REFERENCES [dbo].[FactInternetSales] (
[SalesOrderNumber],
[SalesOrderLineNumber]
);
103|2010-09-30 11:12:56.763000000|dbo|ALTER_TABLE|dbo|FactSalesQuota|ALTER TABLE [dbo].[FactSalesQuota] ADD
CONSTRAINT [FK_FactSalesQuota_DimEmployee] FOREIGN KEY
(
[EmployeeKey]
) REFERENCES [dbo].[DimEmployee] (
[EmployeeKey]
),
CONSTRAINT [FK_FactSalesQuota_DimDate] FOREIGN KEY
(
[DateKey]
) REFERENCES [dbo].[DimDate] (
[DateKey]
);
|ALTER_TABLE2010-09-30T11:12:56.76051JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboFactSalesQuotaTABLEFK_FactSalesQuota_DimEmployeeFK_FactSalesQuota_DimDateALTER TABLE [dbo].[FactSalesQuota] ADD
CONSTRAINT [FK_FactSalesQuota_DimEmployee] FOREIGN KEY
(
[EmployeeKey]
) REFERENCES [dbo].[DimEmployee] (
[EmployeeKey]
),
CONSTRAINT [FK_FactSalesQuota_DimDate] FOREIGN KEY
(
[DateKey]
) REFERENCES [dbo].[DimDate] (
[DateKey]
);
101|2010-09-30 11:12:56.540000000|dbo|ALTER_TABLE|dbo|FactInternetSales|ALTER TABLE [dbo].[FactInternetSales] ADD
CONSTRAINT [FK_FactInternetSales_DimCurrency] FOREIGN KEY
(
[CurrencyKey]
) REFERENCES [dbo].[DimCurrency] (
[CurrencyKey]
),
CONSTRAINT [FK_FactInternetSales_DimCustomer] FOREIGN KEY
(
[CustomerKey]
) REFERENCES [dbo].[DimCustomer] (
[CustomerKey]
),
CONSTRAINT [FK_FactInternetSales_DimProduct] FOREIGN KEY
(
[ProductKey]
) REFERENCES [dbo].[DimProduct] (
[ProductKey]
),
CONSTRAINT [FK_FactInternetSales_DimPromotion] FOREIGN KEY
(
[PromotionKey]
) REFERENCES [dbo].[DimPromotion] (
[PromotionKey]
),
CONSTRAINT [FK_FactInternetSales_DimDate] FOREIGN KEY
(
[OrderDateKey]
) REFERENCES [dbo].[DimDate] (
[DateKey]
),
CONSTRAINT [FK_FactInternetSales_DimDate1] FOREIGN KEY
(
[DueDateKey]
) REFERENCES [dbo].[DimDate] (
[DateKey]
),
CONSTRAINT [FK_FactInternetSales_DimDate2] FOREIGN KEY
(
[ShipDateKey]
) REFERENCES [dbo].[DimDate] (
[DateKey]
),
CONSTRAINT [FK_FactInternetSales_DimSalesTerritory] FOREIGN KEY
(
[SalesTerritoryKey]
) REFERENCES [dbo].[DimSalesTerritory] (
[SalesTerritoryKey]
);
|ALTER_TABLE2010-09-30T11:12:56.54051JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboFactInternetSalesTABLEFK_FactInternetSales_DimCurrencyFK_FactInternetSales_DimCustomerFK_FactInternetSales_DimProductFK_FactInternetSales_DimPromotionFK_FactInternetSales_DimDateFK_FactInternetSales_DimDate1FK_FactInternetSales_DimDate2FK_FactInternetSales_DimSalesTerritoryALTER TABLE [dbo].[FactInternetSales] ADD
CONSTRAINT [FK_FactInternetSales_DimCurrency] FOREIGN KEY
(
[CurrencyKey]
) REFERENCES [dbo].[DimCurrency] (
[CurrencyKey]
),
CONSTRAINT [FK_FactInternetSales_DimCustomer] FOREIGN KEY
(
[CustomerKey]
) REFERENCES [dbo].[DimCustomer] (
[CustomerKey]
),
CONSTRAINT [FK_FactInternetSales_DimProduct] FOREIGN KEY
(
[ProductKey]
) REFERENCES [dbo].[DimProduct] (
[ProductKey]
),
CONSTRAINT [FK_FactInternetSales_DimPromotion] FOREIGN KEY
(
[PromotionKey]
) REFERENCES [dbo].[DimPromotion] (
[PromotionKey]
),
CONSTRAINT [FK_FactInternetSales_DimDate] FOREIGN KEY
(
[OrderDateKey]
) REFERENCES [dbo].[DimDate] (
[DateKey]
),
CONSTRAINT [FK_FactInternetSales_DimDate1] FOREIGN KEY
(
[DueDateKey]
) REFERENCES [dbo].[DimDate] (
[DateKey]
),
CONSTRAINT [FK_FactInternetSales_DimDate2] FOREIGN KEY
(
[ShipDateKey]
) REFERENCES [dbo].[DimDate] (
[DateKey]
),
CONSTRAINT [FK_FactInternetSales_DimSalesTerritory] FOREIGN KEY
(
[SalesTerritoryKey]
) REFERENCES [dbo].[DimSalesTerritory] (
[SalesTerritoryKey]
);
102|2010-09-30 11:12:56.753000000|dbo|ALTER_TABLE|dbo|FactResellerSales|ALTER TABLE [dbo].[FactResellerSales] ADD
CONSTRAINT [FK_FactResellerSales_DimCurrency] FOREIGN KEY
(
[CurrencyKey]
) REFERENCES [dbo].[DimCurrency] (
[CurrencyKey]
),
CONSTRAINT [FK_FactResellerSales_DimProduct] FOREIGN KEY
(
[ProductKey]
) REFERENCES [dbo].[DimProduct] (
[ProductKey]
),
CONSTRAINT [FK_FactResellerSales_DimPromotion] FOREIGN KEY
(
[PromotionKey]
) REFERENCES [dbo].[DimPromotion] (
[PromotionKey]
),
CONSTRAINT [FK_FactResellerSales_DimDate] FOREIGN KEY
(
[OrderDateKey]
) REFERENCES [dbo].[DimDate] (
[DateKey]
),
CONSTRAINT [FK_FactResellerSales_DimDate1] FOREIGN KEY
(
[DueDateKey]
) REFERENCES [dbo].[DimDate] (
[DateKey]
),
CONSTRAINT [FK_FactResellerSales_DimDate2] FOREIGN KEY
(
[ShipDateKey]
) REFERENCES [dbo].[DimDate] (
[DateKey]
),
CONSTRAINT [FK_FactResellerSales_DimEmployee] FOREIGN KEY
(
[EmployeeKey]
) REFERENCES [dbo].[DimEmployee] (
[EmployeeKey]
),
CONSTRAINT [FK_FactResellerSales_DimReseller] FOREIGN KEY
(
[ResellerKey]
) REFERENCES [dbo].[DimReseller] (
[ResellerKey]
),
CONSTRAINT [FK_FactResellerSales_DimSalesTerritory] FOREIGN KEY
(
[SalesTerritoryKey]
) REFERENCES [dbo].[DimSalesTerritory] (
[SalesTerritoryKey]
);
|ALTER_TABLE2010-09-30T11:12:56.75351JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboFactResellerSalesTABLEFK_FactResellerSales_DimCurrencyFK_FactResellerSales_DimProductFK_FactResellerSales_DimPromotionFK_FactResellerSales_DimDateFK_FactResellerSales_DimDate1FK_FactResellerSales_DimDate2FK_FactResellerSales_DimEmployeeFK_FactResellerSales_DimResellerFK_FactResellerSales_DimSalesTerritoryALTER TABLE [dbo].[FactResellerSales] ADD
CONSTRAINT [FK_FactResellerSales_DimCurrency] FOREIGN KEY
(
[CurrencyKey]
) REFERENCES [dbo].[DimCurrency] (
[CurrencyKey]
),
CONSTRAINT [FK_FactResellerSales_DimProduct] FOREIGN KEY
(
[ProductKey]
) REFERENCES [dbo].[DimProduct] (
[ProductKey]
),
CONSTRAINT [FK_FactResellerSales_DimPromotion] FOREIGN KEY
(
[PromotionKey]
) REFERENCES [dbo].[DimPromotion] (
[PromotionKey]
),
CONSTRAINT [FK_FactResellerSales_DimDate] FOREIGN KEY
(
[OrderDateKey]
) REFERENCES [dbo].[DimDate] (
[DateKey]
),
CONSTRAINT [FK_FactResellerSales_DimDate1] FOREIGN KEY
(
[DueDateKey]
) REFERENCES [dbo].[DimDate] (
[DateKey]
),
CONSTRAINT [FK_FactResellerSales_DimDate2] FOREIGN KEY
(
[ShipDateKey]
) REFERENCES [dbo].[DimDate] (
[DateKey]
),
CONSTRAINT [FK_FactResellerSales_DimEmployee] FOREIGN KEY
(
[EmployeeKey]
) REFERENCES [dbo].[DimEmployee] (
[EmployeeKey]
),
CONSTRAINT [FK_FactResellerSales_DimReseller] FOREIGN KEY
(
[ResellerKey]
) REFERENCES [dbo].[DimReseller] (
[ResellerKey]
),
CONSTRAINT [FK_FactResellerSales_DimSalesTerritory] FOREIGN KEY
(
[SalesTerritoryKey]
) REFERENCES [dbo].[DimSalesTerritory] (
[SalesTerritoryKey]
);
104|2010-09-30 11:12:56.797000000|dbo|ALTER_TABLE|dbo|FactSurveyResponse|ALTER TABLE [dbo].[FactSurveyResponse] ADD
CONSTRAINT [FK_FactSurveyResponse_DateKey] FOREIGN KEY
(
[DateKey]
) REFERENCES [dbo].[DimDate] (
[DateKey]
),
CONSTRAINT [FK_FactSurveyResponse_CustomerKey] FOREIGN KEY
(
[CustomerKey]
) REFERENCES [dbo].[DimCustomer] (
[CustomerKey]
);
|ALTER_TABLE2010-09-30T11:12:56.79751JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboFactSurveyResponseTABLEFK_FactSurveyResponse_DateKeyFK_FactSurveyResponse_CustomerKeyALTER TABLE [dbo].[FactSurveyResponse] ADD
CONSTRAINT [FK_FactSurveyResponse_DateKey] FOREIGN KEY
(
[DateKey]
) REFERENCES [dbo].[DimDate] (
[DateKey]
),
CONSTRAINT [FK_FactSurveyResponse_CustomerKey] FOREIGN KEY
(
[CustomerKey]
) REFERENCES [dbo].[DimCustomer] (
[CustomerKey]
);
105|2010-09-30 11:12:56.800000000|dbo|CREATE_FUNCTION|dbo|udfMinimumDate|
CREATE FUNCTION [dbo].[udfMinimumDate] (
@x DATETIME,
@y DATETIME
) RETURNS DATETIME
AS
BEGIN
DECLARE @z DATETIME
IF @x <= @y
SET @z = @x
ELSE
SET @z = @y
RETURN(@z)
END
|CREATE_FUNCTION2010-09-30T11:12:56.80051JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboudfMinimumDateFUNCTION
CREATE FUNCTION [dbo].[udfMinimumDate] (
@x DATETIME,
@y DATETIME
) RETURNS DATETIME
AS
BEGIN
DECLARE @z DATETIME
IF @x <= @y
SET @z = @x
ELSE
SET @z = @y
RETURN(@z)
END
106|2010-09-30 11:12:56.813000000|dbo|CREATE_FUNCTION|dbo|udfTwoDigitZeroFill|
-- Converts the specified integer (which should be < 100 and > -1)
-- into a two character string, zero filling from the left
-- if the number is < 10.
CREATE FUNCTION [dbo].[udfTwoDigitZeroFill] (@number int)
RETURNS char(2)
AS
BEGIN
DECLARE @result char(2);
IF @number > 9
SET @result = convert(char(2), @number);
ELSE
SET @result = convert(char(2), '0' + convert(varchar, @number));
RETURN @result;
END
|CREATE_FUNCTION2010-09-30T11:12:56.81351JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboudfTwoDigitZeroFillFUNCTION
-- Converts the specified integer (which should be < 100 and > -1)
-- into a two character string, zero filling from the left
-- if the number is < 10.
CREATE FUNCTION [dbo].[udfTwoDigitZeroFill] (@number int)
RETURNS char(2)
AS
BEGIN
DECLARE @result char(2);
IF @number > 9
SET @result = convert(char(2), @number);
ELSE
SET @result = convert(char(2), '0' + convert(varchar, @number));
RETURN @result;
END
107|2010-09-30 11:12:56.840000000|dbo|CREATE_FUNCTION|dbo|udfBuildISO8601Date|
-- Builds an ISO 8601 format date from a year, month, and day specified as integers.
-- This format of date should parse correctly regardless of SET DATEFORMAT and SET LANGUAGE.
-- See SQL Server Books Online for more details.
CREATE FUNCTION [dbo].[udfBuildISO8601Date] (@year int, @month int, @day int)
RETURNS datetime
AS
BEGIN
RETURN cast(convert(varchar, @year) + '-' + [dbo].[udfTwoDigitZeroFill](@month)
+ '-' + [dbo].[udfTwoDigitZeroFill](@day) + 'T00:00:00'
as datetime);
END
|CREATE_FUNCTION2010-09-30T11:12:56.84051JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dboudfBuildISO8601DateFUNCTION
-- Builds an ISO 8601 format date from a year, month, and day specified as integers.
-- This format of date should parse correctly regardless of SET DATEFORMAT and SET LANGUAGE.
-- See SQL Server Books Online for more details.
CREATE FUNCTION [dbo].[udfBuildISO8601Date] (@year int, @month int, @day int)
RETURNS datetime
AS
BEGIN
RETURN cast(convert(varchar, @year) + '-' + [dbo].[udfTwoDigitZeroFill](@month)
+ '-' + [dbo].[udfTwoDigitZeroFill](@day) + 'T00:00:00'
as datetime);
END
108|2010-09-30 11:12:56.853000000|dbo|CREATE_VIEW|dbo|vDMPrep|
-- vDMPrep will be used as a data source by the other data mining views.
-- Uses DW data at customer, product, day, etc. granularity and
-- gets region, model, year, month, etc.
CREATE VIEW [dbo].[vDMPrep]
AS
SELECT
pc.[EnglishProductCategoryName]
,Coalesce(p.[ModelName], p.[EnglishProductName]) AS [Model]
,c.[CustomerKey]
,s.[SalesTerritoryGroup] AS [Region]
,CASE
WHEN Month(GetDate()) < Month(c.[BirthDate])
THEN DateDiff(yy,c.[BirthDate],GetDate()) - 1
WHEN Month(GetDate()) = Month(c.[BirthDate])
AND Day(GetDate()) < Day(c.[BirthDate])
THEN DateDiff(yy,c.[BirthDate],GetDate()) - 1
ELSE DateDiff(yy,c.[BirthDate],GetDate())
END AS [Age]
,CASE
WHEN c.[YearlyIncome] < 40000 THEN 'Low'
WHEN c.[YearlyIncome] > 60000 THEN 'High'
ELSE 'Moderate'
END AS [IncomeGroup]
,d.[CalendarYear]
,d.[FiscalYear]
,d.[MonthNumberOfYear] AS [Month]
,f.[SalesOrderNumber] AS [OrderNumber]
,f.SalesOrderLineNumber AS LineNumber
,f.OrderQuantity AS Quantity
,f.ExtendedAmount AS Amount
FROM
[dbo].[FactInternetSales] f
INNER JOIN [dbo].[DimDate] d
ON f.[OrderDateKey] = d.[DateKey]
INNER JOIN [dbo].[DimProduct] p
ON f.[ProductKey] = p.[ProductKey]
INNER JOIN [dbo].[DimProductSubcategory] psc
ON p.[ProductSubcategoryKey] = psc.[ProductSubcategoryKey]
INNER JOIN [dbo].[DimProductCategory] pc
ON psc.[ProductCategoryKey] = pc.[ProductCategoryKey]
INNER JOIN [dbo].[DimCustomer] c
ON f.[CustomerKey] = c.[CustomerKey]
INNER JOIN [dbo].[DimGeography] g
ON c.[GeographyKey] = g.[GeographyKey]
INNER JOIN [dbo].[DimSalesTerritory] s
ON g.[SalesTerritoryKey] = s.[SalesTerritoryKey]
;
|CREATE_VIEW2010-09-30T11:12:56.85351JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dbovDMPrepVIEW
-- vDMPrep will be used as a data source by the other data mining views.
-- Uses DW data at customer, product, day, etc. granularity and
-- gets region, model, year, month, etc.
CREATE VIEW [dbo].[vDMPrep]
AS
SELECT
pc.[EnglishProductCategoryName]
,Coalesce(p.[ModelName], p.[EnglishProductName]) AS [Model]
,c.[CustomerKey]
,s.[SalesTerritoryGroup] AS [Region]
,CASE
WHEN Month(GetDate()) < Month(c.[BirthDate])
THEN DateDiff(yy,c.[BirthDate],GetDate()) - 1
WHEN Month(GetDate()) = Month(c.[BirthDate])
AND Day(GetDate()) < Day(c.[BirthDate])
THEN DateDiff(yy,c.[BirthDate],GetDate()) - 1
ELSE DateDiff(yy,c.[BirthDate],GetDate())
END AS [Age]
,CASE
WHEN c.[YearlyIncome] < 40000 THEN 'Low'
WHEN c.[YearlyIncome] > 60000 THEN 'High'
ELSE 'Moderate'
END AS [IncomeGroup]
,d.[CalendarYear]
,d.[FiscalYear]
,d.[MonthNumberOfYear] AS [Month]
,f.[SalesOrderNumber] AS [OrderNumber]
,f.SalesOrderLineNumber AS LineNumber
,f.OrderQuantity AS Quantity
,f.ExtendedAmount AS Amount
FROM
[dbo].[FactInternetSales] f
INNER JOIN [dbo].[DimDate] d
ON f.[OrderDateKey] = d.[DateKey]
INNER JOIN [dbo].[DimProduct] p
ON f.[ProductKey] = p.[ProductKey]
INNER JOIN [dbo].[DimProductSubcategory] psc
ON p.[ProductSubcategoryKey] = psc.[ProductSubcategoryKey]
INNER JOIN [dbo].[DimProductCategory] pc
ON psc.[ProductCategoryKey] = pc.[ProductCategoryKey]
INNER JOIN [dbo].[DimCustomer] c
ON f.[CustomerKey] = c.[CustomerKey]
INNER JOIN [dbo].[DimGeography] g
ON c.[GeographyKey] = g.[GeographyKey]
INNER JOIN [dbo].[DimSalesTerritory] s
ON g.[SalesTerritoryKey] = s.[SalesTerritoryKey]
;
111|2010-09-30 11:12:56.877000000|dbo|CREATE_VIEW|dbo|vAssocSeqOrders|
-- vAssocSeqOrders supports assocation and sequence clustering data mmining models.
-- - Limits data to FY2004.
-- - Creates order case table and line item nested table.
CREATE VIEW [dbo].[vAssocSeqOrders]
AS
SELECT DISTINCT
[OrderNumber]
,[CustomerKey]
,[Region]
,[IncomeGroup]
FROM
[dbo].[vDMPrep]
WHERE
[FiscalYear] = '2004'
|CREATE_VIEW2010-09-30T11:12:56.87751JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dbovAssocSeqOrdersVIEW
-- vAssocSeqOrders supports assocation and sequence clustering data mmining models.
-- - Limits data to FY2004.
-- - Creates order case table and line item nested table.
CREATE VIEW [dbo].[vAssocSeqOrders]
AS
SELECT DISTINCT
[OrderNumber]
,[CustomerKey]
,[Region]
,[IncomeGroup]
FROM
[dbo].[vDMPrep]
WHERE
[FiscalYear] = '2004'
109|2010-09-30 11:12:56.867000000|dbo|CREATE_VIEW|dbo|vTimeSeries|
-- vTimeSeries view supports the creation of time series data mining models.
-- - Replaces earlier bike models with successor models.
-- - Abbreviates model names to improve readability in mining model viewer
-- - Concatenates model and region so that table only has one input.
-- - Creates a date field indexed to monthly reporting date for use in prediction.
CREATE VIEW [dbo].[vTimeSeries]
AS
SELECT
CASE [Model]
WHEN 'Mountain-100' THEN 'M200'
WHEN 'Road-150' THEN 'R250'
WHEN 'Road-650' THEN 'R750'
WHEN 'Touring-1000' THEN 'T1000'
ELSE Left([Model], 1) + Right([Model], 3)
END + ' ' + [Region] AS [ModelRegion]
,(Convert(Integer, [CalendarYear]) * 100) + Convert(Integer, [Month]) AS [TimeIndex]
,Sum([Quantity]) AS [Quantity]
,Sum([Amount]) AS [Amount]
,CalendarYear
,[Month]
,[dbo].[udfBuildISO8601Date] ([CalendarYear], [Month], 25)
as ReportingDate
FROM
[dbo].[vDMPrep]
WHERE
[Model] IN ('Mountain-100', 'Mountain-200', 'Road-150', 'Road-250',
'Road-650', 'Road-750', 'Touring-1000')
GROUP BY
CASE [Model]
WHEN 'Mountain-100' THEN 'M200'
WHEN 'Road-150' THEN 'R250'
WHEN 'Road-650' THEN 'R750'
WHEN 'Touring-1000' THEN 'T1000'
ELSE Left(Model,1) + Right(Model,3)
END + ' ' + [Region]
,(Convert(Integer, [CalendarYear]) * 100) + Convert(Integer, [Month])
,CalendarYear
,[Month]
,[dbo].[udfBuildISO8601Date] ([CalendarYear], [Month], 25);
|CREATE_VIEW2010-09-30T11:12:56.86751JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dbovTimeSeriesVIEW
-- vTimeSeries view supports the creation of time series data mining models.
-- - Replaces earlier bike models with successor models.
-- - Abbreviates model names to improve readability in mining model viewer
-- - Concatenates model and region so that table only has one input.
-- - Creates a date field indexed to monthly reporting date for use in prediction.
CREATE VIEW [dbo].[vTimeSeries]
AS
SELECT
CASE [Model]
WHEN 'Mountain-100' THEN 'M200'
WHEN 'Road-150' THEN 'R250'
WHEN 'Road-650' THEN 'R750'
WHEN 'Touring-1000' THEN 'T1000'
ELSE Left([Model], 1) + Right([Model], 3)
END + ' ' + [Region] AS [ModelRegion]
,(Convert(Integer, [CalendarYear]) * 100) + Convert(Integer, [Month]) AS [TimeIndex]
,Sum([Quantity]) AS [Quantity]
,Sum([Amount]) AS [Amount]
,CalendarYear
,[Month]
,[dbo].[udfBuildISO8601Date] ([CalendarYear], [Month], 25)
as ReportingDate
FROM
[dbo].[vDMPrep]
WHERE
[Model] IN ('Mountain-100', 'Mountain-200', 'Road-150', 'Road-250',
'Road-650', 'Road-750', 'Touring-1000')
GROUP BY
CASE [Model]
WHEN 'Mountain-100' THEN 'M200'
WHEN 'Road-150' THEN 'R250'
WHEN 'Road-650' THEN 'R750'
WHEN 'Touring-1000' THEN 'T1000'
ELSE Left(Model,1) + Right(Model,3)
END + ' ' + [Region]
,(Convert(Integer, [CalendarYear]) * 100) + Convert(Integer, [Month])
,CalendarYear
,[Month]
,[dbo].[udfBuildISO8601Date] ([CalendarYear], [Month], 25);
110|2010-09-30 11:12:56.873000000|dbo|CREATE_VIEW|dbo|vTargetMail|
-- vTargetMail supports targeted mailing data model
-- Uses vDMPrep to determine if a customer buys a bike and joins to DimCustomer
CREATE VIEW [dbo].[vTargetMail]
AS
SELECT
c.[CustomerKey],
c.[GeographyKey],
c.[CustomerAlternateKey],
c.[Title],
c.[FirstName],
c.[MiddleName],
c.[LastName],
c.[NameStyle],
c.[BirthDate],
c.[MaritalStatus],
c.[Suffix],
c.[Gender],
c.[EmailAddress],
c.[YearlyIncome],
c.[TotalChildren],
c.[NumberChildrenAtHome],
c.[EnglishEducation],
c.[SpanishEducation],
c.[FrenchEducation],
c.[EnglishOccupation],
c.[SpanishOccupation],
c.[FrenchOccupation],
c.[HouseOwnerFlag],
c.[NumberCarsOwned],
c.[AddressLine1],
c.[AddressLine2],
c.[Phone],
c.[DateFirstPurchase],
c.[CommuteDistance],
x.[Region],
x.[Age],
CASE x.[Bikes]
WHEN 0 THEN 0
ELSE 1
END AS [BikeBuyer]
FROM
[dbo].[DimCustomer] c INNER JOIN (
SELECT
[CustomerKey]
,[Region]
,[Age]
,Sum(
CASE [EnglishProductCategoryName]
WHEN 'Bikes' THEN 1
ELSE 0
END) AS [Bikes]
FROM
[dbo].[vDMPrep]
GROUP BY
[CustomerKey]
,[Region]
,[Age]
) AS [x]
ON c.[CustomerKey] = x.[CustomerKey]
;
|CREATE_VIEW2010-09-30T11:12:56.87051JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dbovTargetMailVIEW
-- vTargetMail supports targeted mailing data model
-- Uses vDMPrep to determine if a customer buys a bike and joins to DimCustomer
CREATE VIEW [dbo].[vTargetMail]
AS
SELECT
c.[CustomerKey],
c.[GeographyKey],
c.[CustomerAlternateKey],
c.[Title],
c.[FirstName],
c.[MiddleName],
c.[LastName],
c.[NameStyle],
c.[BirthDate],
c.[MaritalStatus],
c.[Suffix],
c.[Gender],
c.[EmailAddress],
c.[YearlyIncome],
c.[TotalChildren],
c.[NumberChildrenAtHome],
c.[EnglishEducation],
c.[SpanishEducation],
c.[FrenchEducation],
c.[EnglishOccupation],
c.[SpanishOccupation],
c.[FrenchOccupation],
c.[HouseOwnerFlag],
c.[NumberCarsOwned],
c.[AddressLine1],
c.[AddressLine2],
c.[Phone],
c.[DateFirstPurchase],
c.[CommuteDistance],
x.[Region],
x.[Age],
CASE x.[Bikes]
WHEN 0 THEN 0
ELSE 1
END AS [BikeBuyer]
FROM
[dbo].[DimCustomer] c INNER JOIN (
SELECT
[CustomerKey]
,[Region]
,[Age]
,Sum(
CASE [EnglishProductCategoryName]
WHEN 'Bikes' THEN 1
ELSE 0
END) AS [Bikes]
FROM
[dbo].[vDMPrep]
GROUP BY
[CustomerKey]
,[Region]
,[Age]
) AS [x]
ON c.[CustomerKey] = x.[CustomerKey]
;
112|2010-09-30 11:12:56.880000000|dbo|CREATE_VIEW|dbo|vAssocSeqLineItems|
CREATE VIEW [dbo].[vAssocSeqLineItems]
AS
SELECT
OrderNumber
,LineNumber
,Model
FROM
[dbo].[vDMPrep]
WHERE
FiscalYear = '2004'
;
|CREATE_VIEW2010-09-30T11:12:56.88051JPJOFRE-NB16NT AUTHORITY\SYSTEMdboAdventureWorksDW2008dbovAssocSeqLineItemsVIEW
CREATE VIEW [dbo].[vAssocSeqLineItems]
AS
SELECT
OrderNumber
,LineNumber
,Model
FROM
[dbo].[vDMPrep]
WHERE
FiscalYear = '2004'
;