mirror of
https://github.com/Microsoft/sql-server-samples.git
synced 2025-12-08 14:58:54 +00:00
321 KiB
321 KiB
| 1 | 1|2010-09-30 11:12:47.467000000|dbo|CREATE_TABLE|dbo|AdventureWorksDWBuildVersion|CREATE TABLE [dbo].[AdventureWorksDWBuildVersion] ( | ||
|---|---|---|---|
| 2 | [DBVersion] [nvarchar] (50) NULL, | ||
| 3 | [VersionDate] [datetime] NULL | ||
| 4 | ) ON [PRIMARY]; | ||
| 5 | [DBVersion] [nvarchar] (50) NULL,
 | ||
| 6 | [VersionDate] [datetime] NULL 
 | ||
| 7 | ) ON [PRIMARY];
 | ||
| 8 | 
 | ||
| 9 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 10 | 2|2010-09-30 11:12:47.470000000|dbo|CREATE_TABLE|dbo|DimAccount|CREATE TABLE [dbo].[DimAccount] ( | ||
| 11 | [AccountKey] [int] IDENTITY(1, 1) NOT NULL, | ||
| 12 | [ParentAccountKey] [int] NULL, | ||
| 13 | [AccountCodeAlternateKey] [int] NULL, | ||
| 14 | [ParentAccountCodeAlternateKey] [int] NULL, | ||
| 15 | [AccountDescription] [nvarchar] (50) NULL, | ||
| 16 | [AccountType] [nvarchar] (50) NULL, | ||
| 17 | [Operator] [nvarchar] (50) NULL, | ||
| 18 | [CustomMembers] [nvarchar] (300) NULL, | ||
| 19 | [ValueType] [nvarchar] (50) NULL, | ||
| 20 | [CustomMemberOptions] [nvarchar] (200) NULL | ||
| 21 | ) ON [PRIMARY]; | ||
| 22 | [AccountKey] [int] IDENTITY(1, 1) NOT NULL,
 | ||
| 23 | [ParentAccountKey] [int] NULL,
 | ||
| 24 | [AccountCodeAlternateKey] [int] NULL,
 | ||
| 25 | [ParentAccountCodeAlternateKey] [int] NULL,
 | ||
| 26 | [AccountDescription] [nvarchar] (50) NULL,
 | ||
| 27 | [AccountType] [nvarchar] (50) NULL,
 | ||
| 28 | [Operator] [nvarchar] (50) NULL,
 | ||
| 29 | [CustomMembers] [nvarchar] (300) NULL,
 | ||
| 30 | [ValueType] [nvarchar] (50) NULL,
 | ||
| 31 | [CustomMemberOptions] [nvarchar] (200) NULL 
 | ||
| 32 | ) ON [PRIMARY];
 | ||
| 33 | 
 | ||
| 34 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 35 | 17|2010-09-30 11:12:47.540000000|dbo|CREATE_TABLE|dbo|DimScenario|CREATE TABLE [dbo].[DimScenario] ( | ||
| 36 | [ScenarioKey] [int] IDENTITY(1, 1) NOT NULL, | ||
| 37 | [ScenarioName] [nvarchar] (50) NULL | ||
| 38 | ) ON [PRIMARY]; | ||
| 39 | [ScenarioKey] [int] IDENTITY(1, 1) NOT NULL,
 | ||
| 40 | [ScenarioName] [nvarchar] (50) NULL 
 | ||
| 41 | ) ON [PRIMARY];
 | ||
| 42 | 
 | ||
| 43 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 44 | 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]; | ||
| 45 | 
 | ||
| 46 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 47 | 3|2010-09-30 11:12:47.473000000|dbo|CREATE_TABLE|dbo|DimCurrency|CREATE TABLE [dbo].[DimCurrency] ( | ||
| 48 | [CurrencyKey] [int] IDENTITY(1, 1) NOT NULL, | ||
| 49 | [CurrencyAlternateKey] [nchar] (3) NOT NULL, | ||
| 50 | [CurrencyName] [nvarchar] (50) NOT NULL | ||
| 51 | ) ON [PRIMARY]; | ||
| 52 | [CurrencyKey] [int] IDENTITY(1, 1) NOT NULL,
 | ||
| 53 | [CurrencyAlternateKey] [nchar] (3) NOT NULL,
 | ||
| 54 | [CurrencyName] [nvarchar] (50) NOT NULL 
 | ||
| 55 | ) ON [PRIMARY];
 | ||
| 56 | 
 | ||
| 57 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 58 | 6|2010-09-30 11:12:47.480000000|dbo|CREATE_TABLE|dbo|DimDepartmentGroup|CREATE TABLE [dbo].[DimDepartmentGroup] ( | ||
| 59 | [DepartmentGroupKey] [int] IDENTITY(1, 1) NOT NULL, | ||
| 60 | [ParentDepartmentGroupKey] [int] NULL, | ||
| 61 | [DepartmentGroupName] [nvarchar] (50) NULL | ||
| 62 | ) ON [PRIMARY]; | ||
| 63 | [DepartmentGroupKey] [int] IDENTITY(1, 1) NOT NULL,
 | ||
| 64 | [ParentDepartmentGroupKey] [int] NULL,
 | ||
| 65 | [DepartmentGroupName] [nvarchar] (50) NULL 
 | ||
| 66 | ) ON [PRIMARY];
 | ||
| 67 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 68 | 8|2010-09-30 11:12:47.497000000|dbo|CREATE_TABLE|dbo|DimGeography|CREATE TABLE [dbo].[DimGeography] ( | ||
| 69 | [GeographyKey] [int] IDENTITY(1, 1) NOT NULL, | ||
| 70 | [City] [nvarchar] (30) NULL, | ||
| 71 | [StateProvinceCode] [nvarchar] (3) NULL, | ||
| 72 | [StateProvinceName] [nvarchar] (50) NULL, | ||
| 73 | [CountryRegionCode] [nvarchar] (3) NULL, | ||
| 74 | [EnglishCountryRegionName] [nvarchar] (50) NULL, | ||
| 75 | [SpanishCountryRegionName] [nvarchar] (50) NULL, | ||
| 76 | [FrenchCountryRegionName] [nvarchar] (50) NULL, | ||
| 77 | [PostalCode] [nvarchar] (15) NULL, | ||
| 78 | [SalesTerritoryKey] [int] NULL | ||
| 79 | ) ON [PRIMARY]; | ||
| 80 | [GeographyKey] [int] IDENTITY(1, 1) NOT NULL,
 | ||
| 81 | [City] [nvarchar] (30) NULL,
 | ||
| 82 | [StateProvinceCode] [nvarchar] (3) NULL,
 | ||
| 83 | [StateProvinceName] [nvarchar] (50) NULL,
 | ||
| 84 | [CountryRegionCode] [nvarchar] (3) NULL,
 | ||
| 85 | [EnglishCountryRegionName] [nvarchar] (50) NULL,
 | ||
| 86 | [SpanishCountryRegionName] [nvarchar] (50) NULL,
 | ||
| 87 | [FrenchCountryRegionName] [nvarchar] (50) NULL,
 | ||
| 88 | [PostalCode] [nvarchar] (15) NULL,
 | ||
| 89 | [SalesTerritoryKey] [int] NULL 
 | ||
| 90 | ) ON [PRIMARY];
 | ||
| 91 | 
 | ||
| 92 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 93 | 4|2010-09-30 11:12:47.477000000|dbo|CREATE_TABLE|dbo|DimCustomer|CREATE TABLE [dbo].[DimCustomer] ( | ||
| 94 | [CustomerKey] [int] IDENTITY(1, 1) NOT NULL, | ||
| 95 | [GeographyKey] [int] NULL, | ||
| 96 | [CustomerAlternateKey] [nvarchar] (15) NOT NULL, | ||
| 97 | [Title] [nvarchar] (8) NULL, | ||
| 98 | [FirstName] [nvarchar] (50) NULL, | ||
| 99 | [MiddleName] [nvarchar] (50) NULL, | ||
| 100 | [LastName] [nvarchar] (50) NULL, | ||
| 101 | [NameStyle] [bit] NULL, | ||
| 102 | [BirthDate] [date] NULL, | ||
| 103 | [MaritalStatus] [nchar] (1) NULL, | ||
| 104 | [Suffix] [nvarchar] (10) NULL, | ||
| 105 | [Gender] [nvarchar] (1) NULL, | ||
| 106 | [EmailAddress] [nvarchar] (50) NULL, | ||
| 107 | [YearlyIncome] [money] NULL, | ||
| 108 | [TotalChildren] [tinyint] NULL, | ||
| 109 | [NumberChildrenAtHome] [tinyint] NULL, | ||
| 110 | [EnglishEducation] [nvarchar] (40) NULL, | ||
| 111 | [SpanishEducation] [nvarchar] (40) NULL, | ||
| 112 | [FrenchEducation] [nvarchar] (40) NULL, | ||
| 113 | [EnglishOccupation] [nvarchar] (100) NULL, | ||
| 114 | [SpanishOccupation] [nvarchar] (100) NULL, | ||
| 115 | [FrenchOccupation] [nvarchar] (100) NULL, | ||
| 116 | [HouseOwnerFlag] [nchar] (1) NULL, | ||
| 117 | [NumberCarsOwned] [tinyint] NULL, | ||
| 118 | [AddressLine1] [nvarchar] (120) NULL, | ||
| 119 | [AddressLine2] [nvarchar] (120) NULL, | ||
| 120 | [Phone] [nvarchar] (20) NULL, | ||
| 121 | [DateFirstPurchase] [date] NULL, | ||
| 122 | [CommuteDistance] [nvarchar] (15) NULL | ||
| 123 | ) ON [PRIMARY]; | ||
| 124 | [CustomerKey] [int] IDENTITY(1, 1) NOT NULL,
 | ||
| 125 | [GeographyKey] [int] NULL,
 | ||
| 126 | [CustomerAlternateKey] [nvarchar] (15) NOT NULL,
 | ||
| 127 | [Title] [nvarchar] (8) NULL,
 | ||
| 128 | [FirstName] [nvarchar] (50) NULL,
 | ||
| 129 | [MiddleName] [nvarchar] (50) NULL,
 | ||
| 130 | [LastName] [nvarchar] (50) NULL,
 | ||
| 131 | [NameStyle] [bit] NULL,
 | ||
| 132 | [BirthDate] [date] NULL,
 | ||
| 133 | [MaritalStatus] [nchar] (1) NULL,
 | ||
| 134 | [Suffix] [nvarchar] (10) NULL,
 | ||
| 135 | [Gender] [nvarchar] (1) NULL,
 | ||
| 136 | [EmailAddress] [nvarchar] (50) NULL,
 | ||
| 137 | [YearlyIncome] [money] NULL,
 | ||
| 138 | [TotalChildren] [tinyint] NULL,
 | ||
| 139 | [NumberChildrenAtHome] [tinyint] NULL,
 | ||
| 140 | [EnglishEducation] [nvarchar] (40) NULL,
 | ||
| 141 | [SpanishEducation] [nvarchar] (40) NULL,
 | ||
| 142 | [FrenchEducation] [nvarchar] (40) NULL,
 | ||
| 143 | [EnglishOccupation] [nvarchar] (100) NULL,
 | ||
| 144 | [SpanishOccupation] [nvarchar] (100) NULL,
 | ||
| 145 | [FrenchOccupation] [nvarchar] (100) NULL,
 | ||
| 146 | [HouseOwnerFlag] [nchar] (1) NULL,
 | ||
| 147 | [NumberCarsOwned] [tinyint] NULL,
 | ||
| 148 | [AddressLine1] [nvarchar] (120) NULL,
 | ||
| 149 | [AddressLine2] [nvarchar] (120) NULL,
 | ||
| 150 | [Phone] [nvarchar] (20) NULL,
 | ||
| 151 | [DateFirstPurchase] [date] NULL,
 | ||
| 152 | [CommuteDistance] [nvarchar] (15) NULL
 | ||
| 153 | ) ON [PRIMARY];
 | ||
| 154 | 
 | ||
| 155 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 156 | 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]; | ||
| 157 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 158 | 5|2010-09-30 11:12:47.477000000|dbo|CREATE_TABLE|dbo|DimDate|CREATE TABLE [dbo].[DimDate] ( | ||
| 159 | [DateKey] int NOT NULL, | ||
| 160 | [FullDateAlternateKey] [date] NOT NULL, | ||
| 161 | [DayNumberOfWeek] [tinyint] NOT NULL, | ||
| 162 | [EnglishDayNameOfWeek] [nvarchar] (10) NOT NULL, | ||
| 163 | [SpanishDayNameOfWeek] [nvarchar] (10) NOT NULL, | ||
| 164 | [FrenchDayNameOfWeek] [nvarchar] (10) NOT NULL, | ||
| 165 | [DayNumberOfMonth] [tinyint] NOT NULL, | ||
| 166 | [DayNumberOfYear] [smallint] NOT NULL, | ||
| 167 | [WeekNumberOfYear] [tinyint] NOT NULL, | ||
| 168 | [EnglishMonthName] [nvarchar] (10) NOT NULL, | ||
| 169 | [SpanishMonthName] [nvarchar] (10) NOT NULL, | ||
| 170 | [FrenchMonthName] [nvarchar] (10) NOT NULL, | ||
| 171 | [MonthNumberOfYear] [tinyint] NOT NULL, | ||
| 172 | [CalendarQuarter] [tinyint] NOT NULL, | ||
| 173 | [CalendarYear] [smallint] NOT NULL, | ||
| 174 | [CalendarSemester] [tinyint] NOT NULL, | ||
| 175 | [FiscalQuarter] [tinyint] NOT NULL, | ||
| 176 | [FiscalYear] [smallint] NOT NULL, | ||
| 177 | [FiscalSemester] [tinyint] NOT NULL | ||
| 178 | ) ON [PRIMARY]; | ||
| 179 | [DateKey] int NOT NULL,
 | ||
| 180 | [FullDateAlternateKey] [date] NOT NULL,
 | ||
| 181 | [DayNumberOfWeek] [tinyint] NOT NULL,
 | ||
| 182 | [EnglishDayNameOfWeek] [nvarchar] (10) NOT NULL,
 | ||
| 183 | [SpanishDayNameOfWeek] [nvarchar] (10) NOT NULL,
 | ||
| 184 | [FrenchDayNameOfWeek] [nvarchar] (10) NOT NULL,
 | ||
| 185 | [DayNumberOfMonth] [tinyint] NOT NULL,
 | ||
| 186 | [DayNumberOfYear] [smallint] NOT NULL,
 | ||
| 187 | [WeekNumberOfYear] [tinyint] NOT NULL,
 | ||
| 188 | [EnglishMonthName] [nvarchar] (10) NOT NULL,
 | ||
| 189 | [SpanishMonthName] [nvarchar] (10) NOT NULL,
 | ||
| 190 | [FrenchMonthName] [nvarchar] (10) NOT NULL,
 | ||
| 191 | [MonthNumberOfYear] [tinyint] NOT NULL,
 | ||
| 192 | [CalendarQuarter] [tinyint] NOT NULL,
 | ||
| 193 | [CalendarYear] [smallint] NOT NULL,
 | ||
| 194 | [CalendarSemester] [tinyint] NOT NULL,
 | ||
| 195 | [FiscalQuarter] [tinyint] NOT NULL,
 | ||
| 196 | [FiscalYear] [smallint] NOT NULL,
 | ||
| 197 | [FiscalSemester] [tinyint] NOT NULL 
 | ||
| 198 | ) ON [PRIMARY];
 | ||
| 199 | 
 | ||
| 200 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 201 | 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]; | ||
| 202 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 203 | 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]; | ||
| 204 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 205 | 7|2010-09-30 11:12:47.493000000|dbo|CREATE_TABLE|dbo|DimEmployee|CREATE TABLE [dbo].[DimEmployee] ( | ||
| 206 | [EmployeeKey] [int] IDENTITY(1, 1) NOT NULL, | ||
| 207 | [ParentEmployeeKey] [int] NULL, | ||
| 208 | [EmployeeNationalIDAlternateKey] [nvarchar] (15) NULL, | ||
| 209 | [ParentEmployeeNationalIDAlternateKey] [nvarchar] (15) NULL, | ||
| 210 | [SalesTerritoryKey] [int] NULL, | ||
| 211 | [FirstName] [nvarchar] (50) NOT NULL, | ||
| 212 | [LastName] [nvarchar] (50) NOT NULL, | ||
| 213 | [MiddleName] [nvarchar] (50) NULL, | ||
| 214 | [NameStyle] [bit] NOT NULL, | ||
| 215 | [Title] [nvarchar] (50) NULL, | ||
| 216 | [HireDate] [date] NULL, | ||
| 217 | [BirthDate] [date] NULL, | ||
| 218 | [LoginID] [nvarchar] (256) NULL, | ||
| 219 | [EmailAddress] [nvarchar] (50) NULL, | ||
| 220 | [Phone] [nvarchar] (25) NULL, | ||
| 221 | [MaritalStatus] [nchar] (1) NULL, | ||
| 222 | [EmergencyContactName] [nvarchar] (50) NULL, | ||
| 223 | [EmergencyContactPhone] [nvarchar] (25) NULL, | ||
| 224 | [SalariedFlag] [bit] NULL, | ||
| 225 | [Gender] [nchar] (1) NULL, | ||
| 226 | [PayFrequency] [tinyint] NULL, | ||
| 227 | [BaseRate] [money] NULL, | ||
| 228 | [VacationHours] [smallint] NULL, | ||
| 229 | [SickLeaveHours] [smallint] NULL, | ||
| 230 | [CurrentFlag] [bit] NOT NULL, | ||
| 231 | [SalesPersonFlag] [bit] NOT NULL, | ||
| 232 | [DepartmentName] [nvarchar] (50) NULL, | ||
| 233 | [StartDate] [date] NULL, | ||
| 234 | [EndDate] [date] NULL, | ||
| 235 | [Status] [nvarchar] (50) | ||
| 236 | ) ON [PRIMARY]; | ||
| 237 | [EmployeeKey] [int] IDENTITY(1, 1) NOT NULL,
 | ||
| 238 | [ParentEmployeeKey] [int] NULL,
 | ||
| 239 | [EmployeeNationalIDAlternateKey] [nvarchar] (15) NULL,
 | ||
| 240 | [ParentEmployeeNationalIDAlternateKey] [nvarchar] (15) NULL,
 | ||
| 241 | [SalesTerritoryKey] [int] NULL,
 | ||
| 242 | [FirstName] [nvarchar] (50) NOT NULL,
 | ||
| 243 | [LastName] [nvarchar] (50) NOT NULL,
 | ||
| 244 | [MiddleName] [nvarchar] (50) NULL,
 | ||
| 245 | [NameStyle] [bit] NOT NULL,
 | ||
| 246 | [Title] [nvarchar] (50) NULL,
 | ||
| 247 | [HireDate] [date] NULL,
 | ||
| 248 | [BirthDate] [date] NULL,
 | ||
| 249 | [LoginID] [nvarchar] (256) NULL,
 | ||
| 250 | [EmailAddress] [nvarchar] (50) NULL,
 | ||
| 251 | [Phone] [nvarchar] (25) NULL,
 | ||
| 252 | [MaritalStatus] [nchar] (1) NULL,
 | ||
| 253 | [EmergencyContactName] [nvarchar] (50) NULL,
 | ||
| 254 | [EmergencyContactPhone] [nvarchar] (25) NULL,
 | ||
| 255 | [SalariedFlag] [bit] NULL,
 | ||
| 256 | [Gender] [nchar] (1) NULL,
 | ||
| 257 | [PayFrequency] [tinyint] NULL,
 | ||
| 258 | [BaseRate] [money] NULL,
 | ||
| 259 | [VacationHours] [smallint] NULL,
 | ||
| 260 | [SickLeaveHours] [smallint] NULL,
 | ||
| 261 | [CurrentFlag] [bit] NOT NULL,
 | ||
| 262 | [SalesPersonFlag] [bit] NOT NULL,
 | ||
| 263 | [DepartmentName] [nvarchar] (50) NULL,
 | ||
| 264 | [StartDate] [date] NULL,
 | ||
| 265 | [EndDate] [date] NULL,
 | ||
| 266 | [Status] [nvarchar] (50)
 | ||
| 267 | ) ON [PRIMARY];
 | ||
| 268 | 
 | ||
| 269 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 270 | 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]; | ||
| 271 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 272 | 9|2010-09-30 11:12:47.497000000|dbo|CREATE_TABLE|dbo|DimOrganization|CREATE TABLE [dbo].[DimOrganization] ( | ||
| 273 | [OrganizationKey] [int] IDENTITY(1, 1) NOT NULL, | ||
| 274 | [ParentOrganizationKey] [int] NULL, | ||
| 275 | [PercentageOfOwnership] [nvarchar] (16) NULL, | ||
| 276 | [OrganizationName] [nvarchar] (50) NULL, | ||
| 277 | [CurrencyKey] [int] NULL | ||
| 278 | ) ON [PRIMARY]; | ||
| 279 | [OrganizationKey] [int] IDENTITY(1, 1) NOT NULL,
 | ||
| 280 | [ParentOrganizationKey] [int] NULL,
 | ||
| 281 | [PercentageOfOwnership] [nvarchar] (16) NULL,
 | ||
| 282 | [OrganizationName] [nvarchar] (50) NULL,
 | ||
| 283 | [CurrencyKey] [int] NULL 
 | ||
| 284 | ) ON [PRIMARY];
 | ||
| 285 | 
 | ||
| 286 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 287 | 11|2010-09-30 11:12:47.527000000|dbo|CREATE_TABLE|dbo|DimProductCategory|CREATE TABLE [dbo].[DimProductCategory] ( | ||
| 288 | [ProductCategoryKey] [int] IDENTITY(1, 1) NOT NULL, | ||
| 289 | [ProductCategoryAlternateKey] [int] NULL, | ||
| 290 | [EnglishProductCategoryName] [nvarchar] (50) NOT NULL, | ||
| 291 | [SpanishProductCategoryName] [nvarchar] (50) NOT NULL, | ||
| 292 | [FrenchProductCategoryName] [nvarchar] (50) NOT NULL | ||
| 293 | ) ON [PRIMARY]; | ||
| 294 | [ProductCategoryKey] [int] IDENTITY(1, 1) NOT NULL,
 | ||
| 295 | [ProductCategoryAlternateKey] [int] NULL,
 | ||
| 296 | [EnglishProductCategoryName] [nvarchar] (50) NOT NULL, 
 | ||
| 297 | [SpanishProductCategoryName] [nvarchar] (50) NOT NULL,
 | ||
| 298 | [FrenchProductCategoryName] [nvarchar] (50) NOT NULL
 | ||
| 299 | ) ON [PRIMARY];
 | ||
| 300 | 
 | ||
| 301 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 302 | 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]; | ||
| 303 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 304 | 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]; | ||
| 305 | 
 | ||
| 306 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 307 | 10|2010-09-30 11:12:47.523000000|dbo|CREATE_TABLE|dbo|DimProduct|CREATE TABLE [dbo].[DimProduct] ( | ||
| 308 | [ProductKey] [int] IDENTITY(1,1) NOT NULL, | ||
| 309 | [ProductAlternateKey] [nvarchar] (25) NULL, | ||
| 310 | [ProductSubcategoryKey] [int] NULL, | ||
| 311 | [WeightUnitMeasureCode] [nchar] (3) NULL, | ||
| 312 | [SizeUnitMeasureCode] [nchar] (3) NULL, | ||
| 313 | [EnglishProductName] [nvarchar] (50) NOT NULL, | ||
| 314 | [SpanishProductName] [nvarchar] (50) NOT NULL, | ||
| 315 | [FrenchProductName] [nvarchar] (50) NOT NULL, | ||
| 316 | [StandardCost] [money] NULL, | ||
| 317 | [FinishedGoodsFlag] [bit] NOT NULL, | ||
| 318 | [Color] [nvarchar] (15) NOT NULL, | ||
| 319 | [SafetyStockLevel] [smallint] NULL, | ||
| 320 | [ReorderPoint] [smallint] NULL, | ||
| 321 | [ListPrice] [money] NULL, | ||
| 322 | [Size] [nvarchar] (50) NULL, | ||
| 323 | [SizeRange] [nvarchar] (50) NULL, | ||
| 324 | [Weight] [float] NULL, | ||
| 325 | [DaysToManufacture] [int] NULL, | ||
| 326 | [ProductLine] [nchar] (2) NULL, | ||
| 327 | [DealerPrice] [money] NULL, | ||
| 328 | [Class] [nchar] (2) NULL, | ||
| 329 | [Style] [nchar] (2) NULL, | ||
| 330 | [ModelName] [nvarchar] (50) NULL, | ||
| 331 | [LargePhoto] [varbinary] (max) NULL, | ||
| 332 | [EnglishDescription] [nvarchar] (400) NULL, | ||
| 333 | [FrenchDescription] [nvarchar] (400) COLLATE French_CI_AS NULL, | ||
| 334 | [ChineseDescription] [nvarchar] (400) COLLATE Chinese_PRC_CI_AI NULL, | ||
| 335 | [ArabicDescription] [nvarchar] (400) COLLATE Arabic_CI_AS NULL, | ||
| 336 | [HebrewDescription] [nvarchar] (400) COLLATE Hebrew_CI_AS NULL, | ||
| 337 | [ThaiDescription] [nvarchar] (400) COLLATE Thai_CI_AS NULL, | ||
| 338 | [GermanDescription] [nvarchar] (400) COLLATE Latin1_General_100_CI_AS NULL, | ||
| 339 | [JapaneseDescription] [nvarchar] (400) COLLATE Japanese_CI_AS NULL, | ||
| 340 | [TurkishDescription] [nvarchar] (400) COLLATE Turkish_CI_AS NULL, | ||
| 341 | [StartDate] [datetime] NULL, | ||
| 342 | [EndDate] [datetime] NULL, | ||
| 343 | [Status] [nvarchar] (7) NULL | ||
| 344 | ) ON [PRIMARY]; | ||
| 345 | [ProductKey] [int] IDENTITY(1,1) NOT NULL,
 | ||
| 346 | [ProductAlternateKey] [nvarchar] (25) NULL,
 | ||
| 347 | [ProductSubcategoryKey] [int] NULL,
 | ||
| 348 | [WeightUnitMeasureCode] [nchar] (3) NULL,
 | ||
| 349 | [SizeUnitMeasureCode] [nchar] (3) NULL,
 | ||
| 350 | [EnglishProductName] [nvarchar] (50) NOT NULL,
 | ||
| 351 | [SpanishProductName] [nvarchar] (50) NOT NULL,
 | ||
| 352 | [FrenchProductName] [nvarchar] (50) NOT NULL,
 | ||
| 353 | [StandardCost] [money] NULL,
 | ||
| 354 | [FinishedGoodsFlag] [bit] NOT NULL,
 | ||
| 355 | [Color] [nvarchar] (15) NOT NULL,
 | ||
| 356 | [SafetyStockLevel] [smallint] NULL,
 | ||
| 357 | [ReorderPoint] [smallint] NULL,
 | ||
| 358 | [ListPrice] [money] NULL,
 | ||
| 359 | [Size] [nvarchar] (50) NULL,
 | ||
| 360 | [SizeRange] [nvarchar] (50) NULL,
 | ||
| 361 | [Weight] [float] NULL,
 | ||
| 362 | [DaysToManufacture] [int] NULL,
 | ||
| 363 | [ProductLine] [nchar] (2) NULL,
 | ||
| 364 | [DealerPrice] [money] NULL,
 | ||
| 365 | [Class] [nchar] (2) NULL,
 | ||
| 366 | [Style] [nchar] (2) NULL,
 | ||
| 367 | [ModelName] [nvarchar] (50) NULL,
 | ||
| 368 | [LargePhoto] [varbinary] (max) NULL,
 | ||
| 369 | [EnglishDescription] [nvarchar] (400) NULL,
 | ||
| 370 | [FrenchDescription] [nvarchar] (400) COLLATE French_CI_AS NULL, 
 | ||
| 371 | [ChineseDescription] [nvarchar] (400) COLLATE Chinese_PRC_CI_AI NULL, 
 | ||
| 372 | [ArabicDescription] [nvarchar] (400) COLLATE Arabic_CI_AS NULL, 
 | ||
| 373 | [HebrewDescription] [nvarchar] (400) COLLATE Hebrew_CI_AS NULL, 
 | ||
| 374 | [ThaiDescription] [nvarchar] (400) COLLATE Thai_CI_AS NULL, 
 | ||
| 375 | [GermanDescription] [nvarchar] (400) COLLATE Latin1_General_100_CI_AS NULL,
 | ||
| 376 | [JapaneseDescription] [nvarchar] (400) COLLATE Japanese_CI_AS NULL,
 | ||
| 377 | [TurkishDescription] [nvarchar] (400) COLLATE Turkish_CI_AS NULL,
 | ||
| 378 | [StartDate] [datetime] NULL,
 | ||
| 379 | [EndDate] [datetime] NULL,
 | ||
| 380 | [Status] [nvarchar] (7) NULL
 | ||
| 381 | ) ON [PRIMARY];
 | ||
| 382 | 
 | ||
| 383 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 384 | 12|2010-09-30 11:12:47.530000000|dbo|CREATE_TABLE|dbo|DimProductSubcategory|CREATE TABLE [dbo].[DimProductSubcategory] ( | ||
| 385 | [ProductSubcategoryKey] [int] IDENTITY(1, 1) NOT NULL, | ||
| 386 | [ProductSubcategoryAlternateKey] [int] NULL, | ||
| 387 | [EnglishProductSubcategoryName] [nvarchar] (50) NOT NULL, | ||
| 388 | [SpanishProductSubcategoryName] [nvarchar] (50) NOT NULL, | ||
| 389 | [FrenchProductSubcategoryName] [nvarchar] (50) NOT NULL, | ||
| 390 | [ProductCategoryKey] [int] NULL | ||
| 391 | ) ON [PRIMARY]; | ||
| 392 | [ProductSubcategoryKey] [int] IDENTITY(1, 1) NOT NULL,
 | ||
| 393 | [ProductSubcategoryAlternateKey] [int] NULL,
 | ||
| 394 | [EnglishProductSubcategoryName] [nvarchar] (50) NOT NULL,
 | ||
| 395 | [SpanishProductSubcategoryName] [nvarchar] (50) NOT NULL,
 | ||
| 396 | [FrenchProductSubcategoryName] [nvarchar] (50) NOT NULL,
 | ||
| 397 | [ProductCategoryKey] [int] NULL 
 | ||
| 398 | ) ON [PRIMARY];
 | ||
| 399 | 
 | ||
| 400 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 401 | 13|2010-09-30 11:12:47.530000000|dbo|CREATE_TABLE|dbo|DimPromotion|CREATE TABLE [dbo].[DimPromotion] ( | ||
| 402 | [PromotionKey] [int] IDENTITY(1, 1) NOT NULL, | ||
| 403 | [PromotionAlternateKey] [int] NULL, | ||
| 404 | [EnglishPromotionName] [nvarchar] (255) NULL, | ||
| 405 | [SpanishPromotionName] [nvarchar] (255) NULL, | ||
| 406 | [FrenchPromotionName] [nvarchar] (255) NULL, | ||
| 407 | [DiscountPct] [float] NULL, | ||
| 408 | [EnglishPromotionType] [nvarchar] (50) NULL, | ||
| 409 | [SpanishPromotionType] [nvarchar] (50) NULL, | ||
| 410 | [FrenchPromotionType] [nvarchar] (50) NULL, | ||
| 411 | [EnglishPromotionCategory] [nvarchar] (50) NULL, | ||
| 412 | [SpanishPromotionCategory] [nvarchar] (50) NULL, | ||
| 413 | [FrenchPromotionCategory] [nvarchar] (50) NULL, | ||
| 414 | [StartDate] [datetime] NOT NULL, | ||
| 415 | [EndDate] [datetime] NULL, | ||
| 416 | [MinQty] [int] NULL, | ||
| 417 | [MaxQty] [int] NULL | ||
| 418 | ) ON [PRIMARY]; | ||
| 419 | [PromotionKey] [int] IDENTITY(1, 1) NOT NULL,
 | ||
| 420 | [PromotionAlternateKey] [int] NULL,
 | ||
| 421 | [EnglishPromotionName] [nvarchar] (255) NULL,
 | ||
| 422 | [SpanishPromotionName] [nvarchar] (255) NULL,
 | ||
| 423 | [FrenchPromotionName] [nvarchar] (255) NULL,
 | ||
| 424 | [DiscountPct] [float] NULL,
 | ||
| 425 | [EnglishPromotionType] [nvarchar] (50) NULL,
 | ||
| 426 | [SpanishPromotionType] [nvarchar] (50) NULL,
 | ||
| 427 | [FrenchPromotionType] [nvarchar] (50) NULL,
 | ||
| 428 | [EnglishPromotionCategory] [nvarchar] (50) NULL,
 | ||
| 429 | [SpanishPromotionCategory] [nvarchar] (50) NULL,
 | ||
| 430 | [FrenchPromotionCategory] [nvarchar] (50) NULL,
 | ||
| 431 | [StartDate] [datetime] NOT NULL,
 | ||
| 432 | [EndDate] [datetime] NULL,
 | ||
| 433 | [MinQty] [int] NULL,
 | ||
| 434 | [MaxQty] [int] NULL 
 | ||
| 435 | ) ON [PRIMARY];
 | ||
| 436 | 
 | ||
| 437 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 438 | 14|2010-09-30 11:12:47.533000000|dbo|CREATE_TABLE|dbo|DimReseller|CREATE TABLE [dbo].[DimReseller] ( | ||
| 439 | [ResellerKey] [int] IDENTITY(1, 1) NOT NULL, | ||
| 440 | [GeographyKey] [int] NULL, | ||
| 441 | [ResellerAlternateKey] [nvarchar] (15) NULL, | ||
| 442 | [Phone] [nvarchar] (25) NULL, | ||
| 443 | [BusinessType] [varchar] (20) NOT NULL, | ||
| 444 | [ResellerName] [nvarchar] (50) NOT NULL, | ||
| 445 | [NumberEmployees] [int] NULL, | ||
| 446 | [OrderFrequency] [char] (1) NULL, | ||
| 447 | [OrderMonth] [tinyint] NULL, | ||
| 448 | [FirstOrderYear] [int] NULL, | ||
| 449 | [LastOrderYear] [int] NULL, | ||
| 450 | [ProductLine] [nvarchar] (50) NULL, | ||
| 451 | [AddressLine1] [nvarchar] (60) NULL, | ||
| 452 | [AddressLine2] [nvarchar] (60) NULL, | ||
| 453 | [AnnualSales] [money] NULL, | ||
| 454 | [BankName] [nvarchar] (50) NULL, | ||
| 455 | [MinPaymentType] [tinyint] NULL, | ||
| 456 | [MinPaymentAmount] [money] NULL, | ||
| 457 | [AnnualRevenue] [money] NULL, | ||
| 458 | [YearOpened] [int] NULL | ||
| 459 | ) ON [PRIMARY]; | ||
| 460 | [ResellerKey] [int] IDENTITY(1, 1) NOT NULL,
 | ||
| 461 | [GeographyKey] [int] NULL,
 | ||
| 462 | [ResellerAlternateKey] [nvarchar] (15) NULL,
 | ||
| 463 | [Phone] [nvarchar] (25) NULL,
 | ||
| 464 | [BusinessType] [varchar] (20) NOT NULL,
 | ||
| 465 | [ResellerName] [nvarchar] (50) NOT NULL,
 | ||
| 466 | [NumberEmployees] [int] NULL,
 | ||
| 467 | [OrderFrequency] [char] (1) NULL,
 | ||
| 468 | [OrderMonth] [tinyint] NULL,
 | ||
| 469 | [FirstOrderYear] [int] NULL,
 | ||
| 470 | [LastOrderYear] [int] NULL,
 | ||
| 471 | [ProductLine] [nvarchar] (50) NULL,
 | ||
| 472 | [AddressLine1] [nvarchar] (60) NULL,
 | ||
| 473 | [AddressLine2] [nvarchar] (60) NULL,
 | ||
| 474 | [AnnualSales] [money] NULL,
 | ||
| 475 | [BankName] [nvarchar] (50) NULL,
 | ||
| 476 | [MinPaymentType] [tinyint] NULL,
 | ||
| 477 | [MinPaymentAmount] [money] NULL,
 | ||
| 478 | [AnnualRevenue] [money] NULL,
 | ||
| 479 | [YearOpened] [int] NULL 
 | ||
| 480 | ) ON [PRIMARY];
 | ||
| 481 | 
 | ||
| 482 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 483 | 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]; | ||
| 484 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 485 | 15|2010-09-30 11:12:47.533000000|dbo|CREATE_TABLE|dbo|DimSalesReason|CREATE TABLE [dbo].[DimSalesReason] ( | ||
| 486 | [SalesReasonKey] [int] IDENTITY(1, 1) NOT NULL, | ||
| 487 | [SalesReasonAlternateKey] [int] NOT NULL, | ||
| 488 | [SalesReasonName] [nvarchar] (50) NOT NULL, | ||
| 489 | [SalesReasonReasonType] [nvarchar] (50) NOT NULL | ||
| 490 | ) ON [PRIMARY]; | ||
| 491 | [SalesReasonKey] [int] IDENTITY(1, 1) NOT NULL,
 | ||
| 492 | [SalesReasonAlternateKey] [int] NOT NULL,
 | ||
| 493 | [SalesReasonName] [nvarchar] (50) NOT NULL,
 | ||
| 494 | [SalesReasonReasonType] [nvarchar] (50) NOT NULL 
 | ||
| 495 | ) ON [PRIMARY];
 | ||
| 496 | 
 | ||
| 497 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 498 | 16|2010-09-30 11:12:47.537000000|dbo|CREATE_TABLE|dbo|DimSalesTerritory|CREATE TABLE [dbo].[DimSalesTerritory] ( | ||
| 499 | [SalesTerritoryKey] [int] IDENTITY(1, 1) NOT NULL, | ||
| 500 | [SalesTerritoryAlternateKey] [int] NULL, | ||
| 501 | [SalesTerritoryRegion] [nvarchar] (50) NOT NULL, | ||
| 502 | [SalesTerritoryCountry] [nvarchar] (50) NOT NULL, | ||
| 503 | [SalesTerritoryGroup] [nvarchar] (50) NULL | ||
| 504 | ) ON [PRIMARY]; | ||
| 505 | [SalesTerritoryKey] [int] IDENTITY(1, 1) NOT NULL,
 | ||
| 506 | [SalesTerritoryAlternateKey] [int] NULL,
 | ||
| 507 | [SalesTerritoryRegion] [nvarchar] (50) NOT NULL,
 | ||
| 508 | [SalesTerritoryCountry] [nvarchar] (50) NOT NULL,
 | ||
| 509 | [SalesTerritoryGroup] [nvarchar] (50) NULL
 | ||
| 510 | ) ON [PRIMARY];
 | ||
| 511 | 
 | ||
| 512 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 513 | 18|2010-09-30 11:12:47.540000000|dbo|CREATE_TABLE|dbo|FactCallCenter|CREATE TABLE [dbo].[FactCallCenter] ( | ||
| 514 | [FactCallCenterID] [int] IDENTITY(1,1) NOT NULL, | ||
| 515 | [DateKey] [int] NOT NULL, | ||
| 516 | [WageType] [nvarchar](15) NOT NULL, | ||
| 517 | [Shift] [nvarchar](20) NOT NULL, | ||
| 518 | [LevelOneOperators] [smallint] NOT NULL, | ||
| 519 | [LevelTwoOperators] [smallint] NOT NULL, | ||
| 520 | [TotalOperators] [smallint] NOT NULL, | ||
| 521 | [Calls] [int] NOT NULL, | ||
| 522 | [AutomaticResponses] [int] NOT NULL, | ||
| 523 | [Orders] [int] NOT NULL, | ||
| 524 | [IssuesRaised] [smallint] NOT NULL, | ||
| 525 | [AverageTimePerIssue] [smallint] NOT NULL, | ||
| 526 | [ServiceGrade] [float] NOT NULL | ||
| 527 | ) ON [PRIMARY]; | ||
| 528 | [FactCallCenterID] [int] IDENTITY(1,1) NOT NULL,
 | ||
| 529 | [DateKey] [int] NOT NULL,
 | ||
| 530 | [WageType] [nvarchar](15) NOT NULL,
 | ||
| 531 | [Shift] [nvarchar](20) NOT NULL,
 | ||
| 532 | [LevelOneOperators] [smallint] NOT NULL,
 | ||
| 533 | [LevelTwoOperators] [smallint] NOT NULL,
 | ||
| 534 | [TotalOperators] [smallint] NOT NULL,
 | ||
| 535 | [Calls] [int] NOT NULL,
 | ||
| 536 | [AutomaticResponses] [int] NOT NULL,
 | ||
| 537 | [Orders] [int] NOT NULL,
 | ||
| 538 | [IssuesRaised] [smallint] NOT NULL,
 | ||
| 539 | [AverageTimePerIssue] [smallint] NOT NULL,
 | ||
| 540 | [ServiceGrade] [float] NOT NULL
 | ||
| 541 | ) ON [PRIMARY];
 | ||
| 542 | 
 | ||
| 543 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 544 | 19|2010-09-30 11:12:47.540000000|dbo|CREATE_TABLE|dbo|FactCurrencyRate|CREATE TABLE [dbo].[FactCurrencyRate] ( | ||
| 545 | [CurrencyKey] [int] NOT NULL, | ||
| 546 | [DateKey] [int] NOT NULL, | ||
| 547 | [AverageRate] [float] NOT NULL, | ||
| 548 | [EndOfDayRate] [float] NOT NULL | ||
| 549 | ) ON [PRIMARY]; | ||
| 550 | [CurrencyKey] [int] NOT NULL,
 | ||
| 551 | [DateKey] [int] NOT NULL,
 | ||
| 552 | [AverageRate] [float] NOT NULL,
 | ||
| 553 | [EndOfDayRate] [float] NOT NULL 
 | ||
| 554 | ) ON [PRIMARY];
 | ||
| 555 | 
 | ||
| 556 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 557 | 20|2010-09-30 11:12:47.543000000|dbo|CREATE_TABLE|dbo|FactFinance|CREATE TABLE [dbo].[FactFinance] ( | ||
| 558 | [FinanceKey] [int] IDENTITY(1, 1) NOT NULL, | ||
| 559 | [DateKey] [int] NOT NULL, | ||
| 560 | [OrganizationKey] [int] NOT NULL, | ||
| 561 | [DepartmentGroupKey] [int] NOT NULL, | ||
| 562 | [ScenarioKey] [int] NOT NULL, | ||
| 563 | [AccountKey] [int] NOT NULL, | ||
| 564 | [Amount] [float] NOT NULL | ||
| 565 | ) ON [PRIMARY]; | ||
| 566 | [FinanceKey] [int] IDENTITY(1, 1) NOT NULL,
 | ||
| 567 | [DateKey] [int] NOT NULL,
 | ||
| 568 | [OrganizationKey] [int] NOT NULL,
 | ||
| 569 | [DepartmentGroupKey] [int] NOT NULL,
 | ||
| 570 | [ScenarioKey] [int] NOT NULL,
 | ||
| 571 | [AccountKey] [int] NOT NULL,
 | ||
| 572 | [Amount] [float] NOT NULL 
 | ||
| 573 | ) ON [PRIMARY];
 | ||
| 574 | 
 | ||
| 575 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 576 | 21|2010-09-30 11:12:47.547000000|dbo|CREATE_TABLE|dbo|FactInternetSales|CREATE TABLE [dbo].[FactInternetSales] ( | ||
| 577 | [ProductKey] [int] NOT NULL, | ||
| 578 | [OrderDateKey] [int] NOT NULL, | ||
| 579 | [DueDateKey] [int] NOT NULL, | ||
| 580 | [ShipDateKey] [int] NOT NULL, | ||
| 581 | [CustomerKey] [int] NOT NULL, | ||
| 582 | [PromotionKey] [int] NOT NULL, | ||
| 583 | [CurrencyKey] [int] NOT NULL, | ||
| 584 | [SalesTerritoryKey] [int] NOT NULL, | ||
| 585 | [SalesOrderNumber] [nvarchar] (20) NOT NULL, | ||
| 586 | [SalesOrderLineNumber] [tinyint] NOT NULL, | ||
| 587 | [RevisionNumber] [tinyint] NOT NULL, | ||
| 588 | [OrderQuantity] [smallint] NOT NULL, | ||
| 589 | [UnitPrice] [money] NOT NULL, | ||
| 590 | [ExtendedAmount] [money] NOT NULL, | ||
| 591 | [UnitPriceDiscountPct] [float] NOT NULL, | ||
| 592 | [DiscountAmount] [float] NOT NULL, | ||
| 593 | [ProductStandardCost] [money] NOT NULL, | ||
| 594 | [TotalProductCost] [money] NOT NULL, | ||
| 595 | [SalesAmount] [money] NOT NULL, | ||
| 596 | [TaxAmt] [money] NOT NULL, | ||
| 597 | [Freight] [money] NOT NULL, | ||
| 598 | [CarrierTrackingNumber] [nvarchar] (25) NULL, | ||
| 599 | [CustomerPONumber] [nvarchar] (25) NULL | ||
| 600 | ) ON [PRIMARY]; | ||
| 601 | [ProductKey] [int] NOT NULL,
 | ||
| 602 | [OrderDateKey] [int] NOT NULL,
 | ||
| 603 | [DueDateKey] [int] NOT NULL,
 | ||
| 604 | [ShipDateKey] [int] NOT NULL,
 | ||
| 605 | [CustomerKey] [int] NOT NULL,
 | ||
| 606 | [PromotionKey] [int] NOT NULL,
 | ||
| 607 | [CurrencyKey] [int] NOT NULL,
 | ||
| 608 | [SalesTerritoryKey] [int] NOT NULL,
 | ||
| 609 | [SalesOrderNumber] [nvarchar] (20) NOT NULL,
 | ||
| 610 | [SalesOrderLineNumber] [tinyint] NOT NULL,
 | ||
| 611 | [RevisionNumber] [tinyint] NOT NULL,
 | ||
| 612 | [OrderQuantity] [smallint] NOT NULL,
 | ||
| 613 | [UnitPrice] [money] NOT NULL,
 | ||
| 614 | [ExtendedAmount] [money] NOT NULL,
 | ||
| 615 | [UnitPriceDiscountPct] [float] NOT NULL,
 | ||
| 616 | [DiscountAmount] [float] NOT NULL,
 | ||
| 617 | [ProductStandardCost] [money] NOT NULL,
 | ||
| 618 | [TotalProductCost] [money] NOT NULL,
 | ||
| 619 | [SalesAmount] [money] NOT NULL,
 | ||
| 620 | [TaxAmt] [money] NOT NULL,
 | ||
| 621 | [Freight] [money] NOT NULL,
 | ||
| 622 | [CarrierTrackingNumber] [nvarchar] (25) NULL,
 | ||
| 623 | [CustomerPONumber] [nvarchar] (25) NULL 
 | ||
| 624 | ) ON [PRIMARY];
 | ||
| 625 | 
 | ||
| 626 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 627 | 22|2010-09-30 11:12:47.550000000|dbo|CREATE_TABLE|dbo|FactResellerSales|CREATE TABLE [dbo].[FactResellerSales] ( | ||
| 628 | [ProductKey] [int] NOT NULL, | ||
| 629 | [OrderDateKey] [int] NOT NULL, | ||
| 630 | [DueDateKey] [int] NOT NULL, | ||
| 631 | [ShipDateKey] [int] NOT NULL, | ||
| 632 | [ResellerKey] [int] NOT NULL, | ||
| 633 | [EmployeeKey] [int] NOT NULL, | ||
| 634 | [PromotionKey] [int] NOT NULL, | ||
| 635 | [CurrencyKey] [int] NOT NULL, | ||
| 636 | [SalesTerritoryKey] [int] NOT NULL, | ||
| 637 | [SalesOrderNumber] [nvarchar] (20) NOT NULL, | ||
| 638 | [SalesOrderLineNumber] [tinyint] NOT NULL, | ||
| 639 | [RevisionNumber] [tinyint] NULL, | ||
| 640 | [OrderQuantity] [smallint] NULL, | ||
| 641 | [UnitPrice] [money] NULL, | ||
| 642 | [ExtendedAmount] [money] NULL, | ||
| 643 | [UnitPriceDiscountPct] [float] NULL, | ||
| 644 | [DiscountAmount] [float] NULL, | ||
| 645 | [ProductStandardCost] [money] NULL, | ||
| 646 | [TotalProductCost] [money] NULL, | ||
| 647 | [SalesAmount] [money] NULL, | ||
| 648 | [TaxAmt] [money] NULL, | ||
| 649 | [Freight] [money] NULL, | ||
| 650 | [CarrierTrackingNumber] [nvarchar] (25) NULL, | ||
| 651 | [CustomerPONumber] [nvarchar] (25) NULL | ||
| 652 | ) ON [PRIMARY]; | ||
| 653 | [ProductKey] [int] NOT NULL,
 | ||
| 654 | [OrderDateKey] [int] NOT NULL,
 | ||
| 655 | [DueDateKey] [int] NOT NULL,
 | ||
| 656 | [ShipDateKey] [int] NOT NULL,
 | ||
| 657 | [ResellerKey] [int] NOT NULL,
 | ||
| 658 | [EmployeeKey] [int] NOT NULL,
 | ||
| 659 | [PromotionKey] [int] NOT NULL,
 | ||
| 660 | [CurrencyKey] [int] NOT NULL,
 | ||
| 661 | [SalesTerritoryKey] [int] NOT NULL,
 | ||
| 662 | [SalesOrderNumber] [nvarchar] (20) NOT NULL,
 | ||
| 663 | [SalesOrderLineNumber] [tinyint] NOT NULL,
 | ||
| 664 | [RevisionNumber] [tinyint] NULL,
 | ||
| 665 | [OrderQuantity] [smallint] NULL,
 | ||
| 666 | [UnitPrice] [money] NULL,
 | ||
| 667 | [ExtendedAmount] [money] NULL,
 | ||
| 668 | [UnitPriceDiscountPct] [float] NULL,
 | ||
| 669 | [DiscountAmount] [float] NULL,
 | ||
| 670 | [ProductStandardCost] [money] NULL,
 | ||
| 671 | [TotalProductCost] [money] NULL,
 | ||
| 672 | [SalesAmount] [money] NULL,
 | ||
| 673 | [TaxAmt] [money] NULL,
 | ||
| 674 | [Freight] [money] NULL,
 | ||
| 675 | [CarrierTrackingNumber] [nvarchar] (25) NULL,
 | ||
| 676 | [CustomerPONumber] [nvarchar] (25) NULL 
 | ||
| 677 | ) ON [PRIMARY];
 | ||
| 678 | 
 | ||
| 679 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 680 | 23|2010-09-30 11:12:47.550000000|dbo|CREATE_TABLE|dbo|FactInternetSalesReason|CREATE TABLE [dbo].[FactInternetSalesReason] ( | ||
| 681 | [SalesOrderNumber] [nvarchar] (20) NOT NULL, | ||
| 682 | [SalesOrderLineNumber] [tinyint] NOT NULL, | ||
| 683 | [SalesReasonKey] [int] NOT NULL | ||
| 684 | ) ON [PRIMARY]; | ||
| 685 | [SalesOrderNumber] [nvarchar] (20) NOT NULL,
 | ||
| 686 | [SalesOrderLineNumber] [tinyint] NOT NULL,
 | ||
| 687 | [SalesReasonKey] [int] NOT NULL 
 | ||
| 688 | ) ON [PRIMARY];
 | ||
| 689 | 
 | ||
| 690 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 691 | 24|2010-09-30 11:12:47.550000000|dbo|CREATE_TABLE|dbo|FactSalesQuota|CREATE TABLE [dbo].[FactSalesQuota] ( | ||
| 692 | [SalesQuotaKey] [int] IDENTITY(1, 1) NOT NULL, | ||
| 693 | [EmployeeKey] [int] NOT NULL, | ||
| 694 | [DateKey] [int] NOT NULL, | ||
| 695 | [CalendarYear] [smallint] NOT NULL, | ||
| 696 | [CalendarQuarter] [tinyint] NOT NULL, | ||
| 697 | [SalesAmountQuota] [money] NOT NULL | ||
| 698 | ) ON [PRIMARY]; | ||
| 699 | [SalesQuotaKey] [int] IDENTITY(1, 1) NOT NULL,
 | ||
| 700 | [EmployeeKey] [int] NOT NULL,
 | ||
| 701 | [DateKey] [int] NOT NULL,
 | ||
| 702 | [CalendarYear] [smallint] NOT NULL,
 | ||
| 703 | [CalendarQuarter] [tinyint] NOT NULL,
 | ||
| 704 | [SalesAmountQuota] [money] NOT NULL 
 | ||
| 705 | ) ON [PRIMARY];
 | ||
| 706 | 
 | ||
| 707 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 708 | 25|2010-09-30 11:12:47.553000000|dbo|CREATE_TABLE|dbo|FactSurveyResponse|CREATE TABLE [dbo].[FactSurveyResponse] ( | ||
| 709 | [SurveyResponseKey] [int] IDENTITY(1, 1) NOT NULL, | ||
| 710 | [DateKey] [int] NOT NULL, | ||
| 711 | [CustomerKey] [int] NOT NULL, | ||
| 712 | [ProductCategoryKey] [int] NOT NULL, | ||
| 713 | [EnglishProductCategoryName] [nvarchar] (50) NOT NULL, | ||
| 714 | [ProductSubcategoryKey] [int] NOT NULL, | ||
| 715 | [EnglishProductSubcategoryName] [nvarchar] (50) NOT NULL, | ||
| 716 | ) ON [PRIMARY]; | ||
| 717 | [SurveyResponseKey] [int] IDENTITY(1, 1) NOT NULL,
 | ||
| 718 | [DateKey] [int] NOT NULL,
 | ||
| 719 | [CustomerKey] [int] NOT NULL,
 | ||
| 720 | [ProductCategoryKey] [int] NOT NULL,
 | ||
| 721 | [EnglishProductCategoryName] [nvarchar] (50) NOT NULL,
 | ||
| 722 | [ProductSubcategoryKey] [int] NOT NULL,
 | ||
| 723 | [EnglishProductSubcategoryName] [nvarchar] (50) NOT NULL,
 | ||
| 724 | ) ON [PRIMARY];
 | ||
| 725 | 
 | ||
| 726 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 727 | 26|2010-09-30 11:12:47.557000000|dbo|CREATE_TABLE|dbo|ProspectiveBuyer|CREATE TABLE [dbo].[ProspectiveBuyer] ( | ||
| 728 | [ProspectiveBuyerKey] [int] IDENTITY(1, 1) NOT NULL, | ||
| 729 | [ProspectAlternateKey] [nvarchar] (15) NULL, | ||
| 730 | [FirstName] [nvarchar] (50) NULL, | ||
| 731 | [MiddleName] [nvarchar] (50) NULL, | ||
| 732 | [LastName] [nvarchar] (50) NULL, | ||
| 733 | [BirthDate] [datetime] NULL, | ||
| 734 | [MaritalStatus] [nchar] (1) NULL, | ||
| 735 | [Gender] [nvarchar] (1) NULL, | ||
| 736 | [EmailAddress] [nvarchar] (50) NULL, | ||
| 737 | [YearlyIncome] [money] NULL, | ||
| 738 | [TotalChildren] [tinyint] NULL, | ||
| 739 | [NumberChildrenAtHome] [tinyint] NULL, | ||
| 740 | [Education] [nvarchar] (40) NULL, | ||
| 741 | [Occupation] [nvarchar] (100) NULL, | ||
| 742 | [HouseOwnerFlag] [nchar] (1) NULL, | ||
| 743 | [NumberCarsOwned] [tinyint] NULL, | ||
| 744 | [AddressLine1] [nvarchar] (120) NULL, | ||
| 745 | [AddressLine2] [nvarchar] (120) NULL, | ||
| 746 | [City] [nvarchar](30) NULL, | ||
| 747 | [StateProvinceCode] [nvarchar] (3) NULL, | ||
| 748 | [PostalCode] [nvarchar](15) NULL, | ||
| 749 | [Phone] [nvarchar] (20) NULL, | ||
| 750 | [Salutation] [nvarchar] (8) NULL, | ||
| 751 | [Unknown] [int] NULL | ||
| 752 | ) ON [PRIMARY]; | ||
| 753 | [ProspectiveBuyerKey] [int] IDENTITY(1, 1) NOT NULL,
 | ||
| 754 | [ProspectAlternateKey] [nvarchar] (15) NULL,
 | ||
| 755 | [FirstName] [nvarchar] (50) NULL,
 | ||
| 756 | [MiddleName] [nvarchar] (50) NULL,
 | ||
| 757 | [LastName] [nvarchar] (50) NULL,
 | ||
| 758 | [BirthDate] [datetime] NULL,
 | ||
| 759 | [MaritalStatus] [nchar] (1) NULL,
 | ||
| 760 | [Gender] [nvarchar] (1) NULL,
 | ||
| 761 | [EmailAddress] [nvarchar] (50) NULL,
 | ||
| 762 | [YearlyIncome] [money] NULL,
 | ||
| 763 | [TotalChildren] [tinyint] NULL,
 | ||
| 764 | [NumberChildrenAtHome] [tinyint] NULL,
 | ||
| 765 | [Education] [nvarchar] (40) NULL,
 | ||
| 766 | [Occupation] [nvarchar] (100) NULL,
 | ||
| 767 | [HouseOwnerFlag] [nchar] (1) NULL,
 | ||
| 768 | [NumberCarsOwned] [tinyint] NULL,
 | ||
| 769 | [AddressLine1] [nvarchar] (120) NULL,
 | ||
| 770 | [AddressLine2] [nvarchar] (120) NULL,
 | ||
| 771 | [City] [nvarchar](30) NULL, 
 | ||
| 772 | [StateProvinceCode] [nvarchar] (3) NULL,
 | ||
| 773 | [PostalCode] [nvarchar](15) NULL, 
 | ||
| 774 | [Phone] [nvarchar] (20) NULL, 
 | ||
| 775 | [Salutation] [nvarchar] (8) NULL, 
 | ||
| 776 | [Unknown] [int] NULL 
 | ||
| 777 | ) ON [PRIMARY];
 | ||
| 778 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 779 | 27|2010-09-30 11:12:51.037000000|dbo|ALTER_TABLE|dbo|DimAccount|ALTER TABLE [dbo].[DimAccount] WITH CHECK ADD | ||
| 780 | CONSTRAINT [PK_DimAccount] PRIMARY KEY CLUSTERED | ||
| 781 | ( | ||
| 782 | [AccountKey] | ||
| 783 | ) ON [PRIMARY]; | ||
| 784 | CONSTRAINT [PK_DimAccount] PRIMARY KEY CLUSTERED 
 | ||
| 785 | (
 | ||
| 786 | [AccountKey]
 | ||
| 787 | ) ON [PRIMARY];
 | ||
| 788 | 
 | ||
| 789 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 790 | 28|2010-09-30 11:12:51.043000000|dbo|ALTER_TABLE|dbo|DimCurrency|ALTER TABLE [dbo].[DimCurrency] WITH CHECK ADD | ||
| 791 | CONSTRAINT [PK_DimCurrency_CurrencyKey] PRIMARY KEY CLUSTERED | ||
| 792 | ( | ||
| 793 | [CurrencyKey] | ||
| 794 | ) ON [PRIMARY]; | ||
| 795 | CONSTRAINT [PK_DimCurrency_CurrencyKey] PRIMARY KEY CLUSTERED 
 | ||
| 796 | (
 | ||
| 797 | [CurrencyKey]
 | ||
| 798 | ) ON [PRIMARY];
 | ||
| 799 | 
 | ||
| 800 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 801 | 29|2010-09-30 11:12:51.290000000|dbo|ALTER_TABLE|dbo|DimCustomer|ALTER TABLE [dbo].[DimCustomer] WITH CHECK ADD | ||
| 802 | CONSTRAINT [PK_DimCustomer_CustomerKey] PRIMARY KEY CLUSTERED | ||
| 803 | ( | ||
| 804 | [CustomerKey] | ||
| 805 | ) ON [PRIMARY]; | ||
| 806 | CONSTRAINT [PK_DimCustomer_CustomerKey] PRIMARY KEY CLUSTERED 
 | ||
| 807 | (
 | ||
| 808 | [CustomerKey]
 | ||
| 809 | ) ON [PRIMARY];
 | ||
| 810 | 
 | ||
| 811 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 812 | 30|2010-09-30 11:12:51.297000000|dbo|ALTER_TABLE|dbo|DimDepartmentGroup|ALTER TABLE [dbo].[DimDepartmentGroup] WITH CHECK ADD | ||
| 813 | CONSTRAINT [PK_DimDepartmentGroup] PRIMARY KEY CLUSTERED | ||
| 814 | ( | ||
| 815 | [DepartmentGroupKey] | ||
| 816 | ) ON [PRIMARY]; | ||
| 817 | CONSTRAINT [PK_DimDepartmentGroup] PRIMARY KEY CLUSTERED 
 | ||
| 818 | (
 | ||
| 819 | [DepartmentGroupKey]
 | ||
| 820 | ) ON [PRIMARY];
 | ||
| 821 | 
 | ||
| 822 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 823 | 31|2010-09-30 11:12:51.303000000|dbo|ALTER_TABLE|dbo|DimEmployee|ALTER TABLE [dbo].[DimEmployee] WITH CHECK ADD | ||
| 824 | CONSTRAINT [PK_DimEmployee_EmployeeKey] PRIMARY KEY CLUSTERED | ||
| 825 | ( | ||
| 826 | [EmployeeKey] | ||
| 827 | ) ON [PRIMARY]; | ||
| 828 | CONSTRAINT [PK_DimEmployee_EmployeeKey] PRIMARY KEY CLUSTERED 
 | ||
| 829 | (
 | ||
| 830 | [EmployeeKey]
 | ||
| 831 | ) ON [PRIMARY];
 | ||
| 832 | 
 | ||
| 833 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 834 | 32|2010-09-30 11:12:51.317000000|dbo|ALTER_TABLE|dbo|DimGeography|ALTER TABLE [dbo].[DimGeography] WITH CHECK ADD | ||
| 835 | CONSTRAINT [PK_DimGeography_GeographyKey] PRIMARY KEY CLUSTERED | ||
| 836 | ( | ||
| 837 | [GeographyKey] | ||
| 838 | ) ON [PRIMARY]; | ||
| 839 | CONSTRAINT [PK_DimGeography_GeographyKey] PRIMARY KEY CLUSTERED 
 | ||
| 840 | (
 | ||
| 841 | [GeographyKey]
 | ||
| 842 | ) ON [PRIMARY];
 | ||
| 843 | 
 | ||
| 844 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 845 | 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]; | ||
| 846 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 847 | 33|2010-09-30 11:12:51.320000000|dbo|ALTER_TABLE|dbo|DimOrganization|ALTER TABLE [dbo].[DimOrganization] WITH CHECK ADD | ||
| 848 | CONSTRAINT [PK_DimOrganization] PRIMARY KEY CLUSTERED | ||
| 849 | ( | ||
| 850 | [OrganizationKey] | ||
| 851 | ) ON [PRIMARY]; | ||
| 852 | CONSTRAINT [PK_DimOrganization] PRIMARY KEY CLUSTERED 
 | ||
| 853 | (
 | ||
| 854 | [OrganizationKey]
 | ||
| 855 | ) ON [PRIMARY];
 | ||
| 856 | 
 | ||
| 857 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 858 | 34|2010-09-30 11:12:51.357000000|dbo|ALTER_TABLE|dbo|DimProduct|ALTER TABLE [dbo].[DimProduct] WITH CHECK ADD | ||
| 859 | CONSTRAINT [PK_DimProduct_ProductKey] PRIMARY KEY CLUSTERED | ||
| 860 | ( | ||
| 861 | [ProductKey] | ||
| 862 | ) ON [PRIMARY]; | ||
| 863 | CONSTRAINT [PK_DimProduct_ProductKey] PRIMARY KEY CLUSTERED 
 | ||
| 864 | (
 | ||
| 865 | [ProductKey]
 | ||
| 866 | ) ON [PRIMARY];
 | ||
| 867 | 
 | ||
| 868 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 869 | 35|2010-09-30 11:12:51.360000000|dbo|ALTER_TABLE|dbo|DimProductCategory|ALTER TABLE [dbo].[DimProductCategory] WITH CHECK ADD | ||
| 870 | CONSTRAINT [PK_DimProductCategory_ProductCategoryKey] PRIMARY KEY CLUSTERED | ||
| 871 | ( | ||
| 872 | [ProductCategoryKey] | ||
| 873 | ) ON [PRIMARY]; | ||
| 874 | CONSTRAINT [PK_DimProductCategory_ProductCategoryKey] PRIMARY KEY CLUSTERED 
 | ||
| 875 | (
 | ||
| 876 | [ProductCategoryKey]
 | ||
| 877 | ) ON [PRIMARY];
 | ||
| 878 | 
 | ||
| 879 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 880 | 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]; | ||
| 881 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 882 | 36|2010-09-30 11:12:51.367000000|dbo|ALTER_TABLE|dbo|DimProductSubcategory|ALTER TABLE [dbo].[DimProductSubcategory] WITH CHECK ADD | ||
| 883 | CONSTRAINT [PK_DimProductSubcategory_ProductSubcategoryKey] PRIMARY KEY CLUSTERED | ||
| 884 | ( | ||
| 885 | [ProductSubcategoryKey] | ||
| 886 | ) ON [PRIMARY]; | ||
| 887 | CONSTRAINT [PK_DimProductSubcategory_ProductSubcategoryKey] PRIMARY KEY CLUSTERED 
 | ||
| 888 | (
 | ||
| 889 | [ProductSubcategoryKey]
 | ||
| 890 | ) ON [PRIMARY];
 | ||
| 891 | 
 | ||
| 892 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 893 | 37|2010-09-30 11:12:51.370000000|dbo|ALTER_TABLE|dbo|DimPromotion|ALTER TABLE [dbo].[DimPromotion] WITH CHECK ADD | ||
| 894 | CONSTRAINT [PK_DimPromotion_PromotionKey] PRIMARY KEY CLUSTERED | ||
| 895 | ( | ||
| 896 | [PromotionKey] | ||
| 897 | ) ON [PRIMARY]; | ||
| 898 | CONSTRAINT [PK_DimPromotion_PromotionKey] PRIMARY KEY CLUSTERED 
 | ||
| 899 | (
 | ||
| 900 | [PromotionKey]
 | ||
| 901 | ) ON [PRIMARY];
 | ||
| 902 | 
 | ||
| 903 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 904 | 38|2010-09-30 11:12:51.380000000|dbo|ALTER_TABLE|dbo|DimReseller|ALTER TABLE [dbo].[DimReseller] WITH CHECK ADD | ||
| 905 | CONSTRAINT [PK_DimReseller_ResellerKey] PRIMARY KEY CLUSTERED | ||
| 906 | ( | ||
| 907 | [ResellerKey] | ||
| 908 | ) ON [PRIMARY]; | ||
| 909 | CONSTRAINT [PK_DimReseller_ResellerKey] PRIMARY KEY CLUSTERED 
 | ||
| 910 | (
 | ||
| 911 | [ResellerKey]
 | ||
| 912 | ) ON [PRIMARY];
 | ||
| 913 | 
 | ||
| 914 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 915 | 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]; | ||
| 916 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 917 | 39|2010-09-30 11:12:51.383000000|dbo|ALTER_TABLE|dbo|DimSalesReason|ALTER TABLE [dbo].[DimSalesReason] WITH CHECK ADD | ||
| 918 | CONSTRAINT [PK_DimSalesReason_SalesReasonKey] PRIMARY KEY CLUSTERED | ||
| 919 | ( | ||
| 920 | [SalesReasonKey] | ||
| 921 | ) ON [PRIMARY]; | ||
| 922 | CONSTRAINT [PK_DimSalesReason_SalesReasonKey] PRIMARY KEY CLUSTERED 
 | ||
| 923 | (
 | ||
| 924 | [SalesReasonKey]
 | ||
| 925 | ) ON [PRIMARY];
 | ||
| 926 | 
 | ||
| 927 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 928 | 40|2010-09-30 11:12:51.390000000|dbo|ALTER_TABLE|dbo|DimSalesTerritory|ALTER TABLE [dbo].[DimSalesTerritory] WITH CHECK ADD | ||
| 929 | CONSTRAINT [PK_DimSalesTerritory_SalesTerritoryKey] PRIMARY KEY CLUSTERED | ||
| 930 | ( | ||
| 931 | [SalesTerritoryKey] | ||
| 932 | ) ON [PRIMARY]; | ||
| 933 | CONSTRAINT [PK_DimSalesTerritory_SalesTerritoryKey] PRIMARY KEY CLUSTERED 
 | ||
| 934 | (
 | ||
| 935 | [SalesTerritoryKey]
 | ||
| 936 | ) ON [PRIMARY];
 | ||
| 937 | 
 | ||
| 938 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 939 | 41|2010-09-30 11:12:51.393000000|dbo|ALTER_TABLE|dbo|DimScenario|ALTER TABLE [dbo].[DimScenario] WITH CHECK ADD | ||
| 940 | CONSTRAINT [PK_DimScenario] PRIMARY KEY CLUSTERED | ||
| 941 | ( | ||
| 942 | [ScenarioKey] | ||
| 943 | ) ON [PRIMARY]; | ||
| 944 | CONSTRAINT [PK_DimScenario] PRIMARY KEY CLUSTERED 
 | ||
| 945 | (
 | ||
| 946 | [ScenarioKey]
 | ||
| 947 | ) ON [PRIMARY];
 | ||
| 948 | 
 | ||
| 949 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 950 | 42|2010-09-30 11:12:51.403000000|dbo|ALTER_TABLE|dbo|DimDate|ALTER TABLE [dbo].[DimDate] WITH CHECK ADD | ||
| 951 | CONSTRAINT [PK_DimDate_DateKey] PRIMARY KEY CLUSTERED | ||
| 952 | ( | ||
| 953 | [DateKey] | ||
| 954 | ) ON [PRIMARY]; | ||
| 955 | CONSTRAINT [PK_DimDate_DateKey] PRIMARY KEY CLUSTERED 
 | ||
| 956 | (
 | ||
| 957 | [DateKey]
 | ||
| 958 | ) ON [PRIMARY];
 | ||
| 959 | 
 | ||
| 960 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 961 | 43|2010-09-30 11:12:51.410000000|dbo|ALTER_TABLE|dbo|FactCallCenter|ALTER TABLE [dbo].[FactCallCenter] WITH CHECK ADD | ||
| 962 | CONSTRAINT [PK_FactCallCenter_FactCallCenterID] PRIMARY KEY CLUSTERED | ||
| 963 | ( | ||
| 964 | [FactCallCenterID] | ||
| 965 | ) ON [PRIMARY]; | ||
| 966 | |||
| 967 | CONSTRAINT [PK_FactCallCenter_FactCallCenterID] PRIMARY KEY CLUSTERED
 | ||
| 968 | (
 | ||
| 969 | [FactCallCenterID]
 | ||
| 970 | ) ON [PRIMARY];
 | ||
| 971 | 
 | ||
| 972 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 973 | 44|2010-09-30 11:12:51.457000000|dbo|ALTER_TABLE|dbo|FactCurrencyRate|ALTER TABLE [dbo].[FactCurrencyRate] WITH CHECK ADD | ||
| 974 | CONSTRAINT [PK_FactCurrencyRate_CurrencyKey_DateKey] PRIMARY KEY CLUSTERED | ||
| 975 | ( | ||
| 976 | [CurrencyKey], | ||
| 977 | [DateKey] | ||
| 978 | ) ON [PRIMARY]; | ||
| 979 | CONSTRAINT [PK_FactCurrencyRate_CurrencyKey_DateKey] PRIMARY KEY CLUSTERED
 | ||
| 980 | (
 | ||
| 981 | [CurrencyKey],
 | ||
| 982 | [DateKey]
 | ||
| 983 | ) ON [PRIMARY];
 | ||
| 984 | 
 | ||
| 985 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 986 | 45|2010-09-30 11:12:51.937000000|dbo|ALTER_TABLE|dbo|FactInternetSales|ALTER TABLE [dbo].[FactInternetSales] ADD | ||
| 987 | CONSTRAINT [PK_FactInternetSales_SalesOrderNumber_SalesOrderLineNumber] PRIMARY KEY CLUSTERED | ||
| 988 | ( | ||
| 989 | [SalesOrderNumber], | ||
| 990 | [SalesOrderLineNumber] | ||
| 991 | ) ON [PRIMARY]; | ||
| 992 | CONSTRAINT [PK_FactInternetSales_SalesOrderNumber_SalesOrderLineNumber] PRIMARY KEY CLUSTERED 
 | ||
| 993 | (
 | ||
| 994 | [SalesOrderNumber],
 | ||
| 995 | [SalesOrderLineNumber]
 | ||
| 996 | ) ON [PRIMARY];
 | ||
| 997 | 
 | ||
| 998 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 999 | 46|2010-09-30 11:12:52.437000000|dbo|ALTER_TABLE|dbo|FactResellerSales|ALTER TABLE [dbo].[FactResellerSales] ADD | ||
| 1000 | CONSTRAINT [PK_FactResellerSales_SalesOrderNumber_SalesOrderLineNumber] PRIMARY KEY CLUSTERED | ||
| 1001 | ( | ||
| 1002 | [SalesOrderNumber], | ||
| 1003 | [SalesOrderLineNumber] | ||
| 1004 | ) ON [PRIMARY]; | ||
| 1005 | CONSTRAINT [PK_FactResellerSales_SalesOrderNumber_SalesOrderLineNumber] PRIMARY KEY CLUSTERED 
 | ||
| 1006 | (
 | ||
| 1007 | [SalesOrderNumber],
 | ||
| 1008 | [SalesOrderLineNumber]
 | ||
| 1009 | ) ON [PRIMARY];
 | ||
| 1010 | 
 | ||
| 1011 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 1012 | 47|2010-09-30 11:12:52.603000000|dbo|ALTER_TABLE|dbo|FactInternetSalesReason|ALTER TABLE [dbo].[FactInternetSalesReason] ADD | ||
| 1013 | CONSTRAINT [PK_FactInternetSalesReason_SalesOrderNumber_SalesOrderLineNumber_SalesReasonKey] PRIMARY KEY CLUSTERED | ||
| 1014 | ( | ||
| 1015 | [SalesOrderNumber], | ||
| 1016 | [SalesOrderLineNumber], | ||
| 1017 | [SalesReasonKey] | ||
| 1018 | ) ON [PRIMARY]; | ||
| 1019 | CONSTRAINT [PK_FactInternetSalesReason_SalesOrderNumber_SalesOrderLineNumber_SalesReasonKey] PRIMARY KEY CLUSTERED 
 | ||
| 1020 | (
 | ||
| 1021 | [SalesOrderNumber],
 | ||
| 1022 | [SalesOrderLineNumber],
 | ||
| 1023 | [SalesReasonKey]
 | ||
| 1024 | ) ON [PRIMARY];
 | ||
| 1025 | 
 | ||
| 1026 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 1027 | 48|2010-09-30 11:12:52.610000000|dbo|ALTER_TABLE|dbo|FactSalesQuota|ALTER TABLE [dbo].[FactSalesQuota] ADD | ||
| 1028 | CONSTRAINT [PK_FactSalesQuota_SalesQuotaKey] PRIMARY KEY CLUSTERED | ||
| 1029 | ( | ||
| 1030 | [SalesQuotaKey] | ||
| 1031 | ) ON [PRIMARY]; | ||
| 1032 | |||
| 1033 | CONSTRAINT [PK_FactSalesQuota_SalesQuotaKey] PRIMARY KEY CLUSTERED
 | ||
| 1034 | (
 | ||
| 1035 | [SalesQuotaKey]
 | ||
| 1036 | ) ON [PRIMARY];
 | ||
| 1037 | 
 | ||
| 1038 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 1039 | 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]; | ||
| 1040 | 
 | ||
| 1041 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 1042 | 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]; | ||
| 1043 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 1044 | 49|2010-09-30 11:12:52.620000000|dbo|ALTER_TABLE|dbo|FactSurveyResponse|ALTER TABLE [dbo].[FactSurveyResponse] ADD | ||
| 1045 | CONSTRAINT [PK_FactSurveyResponse_SurveyResponseKey] PRIMARY KEY CLUSTERED | ||
| 1046 | ( | ||
| 1047 | [SurveyResponseKey] | ||
| 1048 | ) ON [PRIMARY]; | ||
| 1049 | CONSTRAINT [PK_FactSurveyResponse_SurveyResponseKey] PRIMARY KEY CLUSTERED
 | ||
| 1050 | (
 | ||
| 1051 | [SurveyResponseKey]
 | ||
| 1052 | ) ON [PRIMARY];
 | ||
| 1053 | 
 | ||
| 1054 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 1055 | 50|2010-09-30 11:12:52.637000000|dbo|ALTER_TABLE|dbo|ProspectiveBuyer|ALTER TABLE [dbo].[ProspectiveBuyer] ADD | ||
| 1056 | CONSTRAINT [PK_ProspectiveBuyer_ProspectiveBuyerKey] PRIMARY KEY CLUSTERED | ||
| 1057 | ( | ||
| 1058 | [ProspectiveBuyerKey] | ||
| 1059 | ) ON [PRIMARY]; | ||
| 1060 | CONSTRAINT [PK_ProspectiveBuyer_ProspectiveBuyerKey] PRIMARY KEY CLUSTERED
 | ||
| 1061 | (
 | ||
| 1062 | [ProspectiveBuyerKey]
 | ||
| 1063 | ) ON [PRIMARY];
 | ||
| 1064 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 1065 | 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]; | ||
| 1066 | 
 | ||
| 1067 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 1068 | 52|2010-09-30 11:12:52.670000000|dbo|ALTER_TABLE|dbo|DimCurrency|ALTER TABLE [dbo].[DimCurrency] ADD | ||
| 1069 | CONSTRAINT [AK_DimCurrency_CurrencyAlternateKey] UNIQUE NONCLUSTERED | ||
| 1070 | ( | ||
| 1071 | [CurrencyAlternateKey] | ||
| 1072 | ) ON [PRIMARY]; | ||
| 1073 | CONSTRAINT [AK_DimCurrency_CurrencyAlternateKey] UNIQUE NONCLUSTERED 
 | ||
| 1074 | (
 | ||
| 1075 | [CurrencyAlternateKey]
 | ||
| 1076 | ) ON [PRIMARY];
 | ||
| 1077 | 
 | ||
| 1078 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 1079 | 53|2010-09-30 11:12:52.710000000|dbo|ALTER_TABLE|dbo|DimCustomer|ALTER TABLE [dbo].[DimCustomer] ADD | ||
| 1080 | CONSTRAINT [IX_DimCustomer_CustomerAlternateKey] UNIQUE NONCLUSTERED | ||
| 1081 | ( | ||
| 1082 | [CustomerAlternateKey] | ||
| 1083 | ) ON [PRIMARY]; | ||
| 1084 | CONSTRAINT [IX_DimCustomer_CustomerAlternateKey] UNIQUE NONCLUSTERED 
 | ||
| 1085 | (
 | ||
| 1086 | [CustomerAlternateKey]
 | ||
| 1087 | ) ON [PRIMARY];
 | ||
| 1088 | 
 | ||
| 1089 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 1090 | 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]; | ||
| 1091 | 
 | ||
| 1092 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 1093 | 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]; | ||
| 1094 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 1095 | 57|2010-09-30 11:12:52.750000000|dbo|ALTER_TABLE|dbo|DimProduct|ALTER TABLE [dbo].[DimProduct] ADD | ||
| 1096 | CONSTRAINT [AK_DimProduct_ProductAlternateKey_StartDate] UNIQUE NONCLUSTERED | ||
| 1097 | ( | ||
| 1098 | [ProductAlternateKey], | ||
| 1099 | [StartDate] | ||
| 1100 | ) ON [PRIMARY]; | ||
| 1101 | CONSTRAINT [AK_DimProduct_ProductAlternateKey_StartDate] UNIQUE NONCLUSTERED 
 | ||
| 1102 | (
 | ||
| 1103 | [ProductAlternateKey],
 | ||
| 1104 | [StartDate]
 | ||
| 1105 | ) ON [PRIMARY];
 | ||
| 1106 | 
 | ||
| 1107 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 1108 | 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]; | ||
| 1109 | 
 | ||
| 1110 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 1111 | 59|2010-09-30 11:12:52.760000000|dbo|ALTER_TABLE|dbo|DimProductCategory|ALTER TABLE [dbo].[DimProductCategory] ADD | ||
| 1112 | CONSTRAINT [AK_DimProductCategory_ProductCategoryAlternateKey] UNIQUE NONCLUSTERED | ||
| 1113 | ( | ||
| 1114 | [ProductCategoryAlternateKey] | ||
| 1115 | ) ON [PRIMARY]; | ||
| 1116 | CONSTRAINT [AK_DimProductCategory_ProductCategoryAlternateKey] UNIQUE NONCLUSTERED 
 | ||
| 1117 | (
 | ||
| 1118 | [ProductCategoryAlternateKey]
 | ||
| 1119 | ) ON [PRIMARY];
 | ||
| 1120 | 
 | ||
| 1121 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 1122 | 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]; | ||
| 1123 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 1124 | 60|2010-09-30 11:12:52.763000000|dbo|ALTER_TABLE|dbo|DimProductSubcategory|ALTER TABLE [dbo].[DimProductSubcategory] ADD | ||
| 1125 | CONSTRAINT [AK_DimProductSubcategory_ProductSubcategoryAlternateKey] UNIQUE NONCLUSTERED | ||
| 1126 | ( | ||
| 1127 | [ProductSubcategoryAlternateKey] | ||
| 1128 | ) ON [PRIMARY]; | ||
| 1129 | CONSTRAINT [AK_DimProductSubcategory_ProductSubcategoryAlternateKey] UNIQUE NONCLUSTERED 
 | ||
| 1130 | (
 | ||
| 1131 | [ProductSubcategoryAlternateKey]
 | ||
| 1132 | ) ON [PRIMARY];
 | ||
| 1133 | 
 | ||
| 1134 | 
 | ||
| 1135 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 1136 | 61|2010-09-30 11:12:52.767000000|dbo|ALTER_TABLE|dbo|DimPromotion|ALTER TABLE [dbo].[DimPromotion] ADD | ||
| 1137 | CONSTRAINT [AK_DimPromotion_PromotionAlternateKey] UNIQUE NONCLUSTERED | ||
| 1138 | ( | ||
| 1139 | [PromotionAlternateKey] | ||
| 1140 | ) ON [PRIMARY]; | ||
| 1141 | CONSTRAINT [AK_DimPromotion_PromotionAlternateKey] UNIQUE NONCLUSTERED 
 | ||
| 1142 | (
 | ||
| 1143 | [PromotionAlternateKey]
 | ||
| 1144 | ) ON [PRIMARY];
 | ||
| 1145 | 
 | ||
| 1146 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 1147 | 62|2010-09-30 11:12:52.773000000|dbo|ALTER_TABLE|dbo|DimReseller|ALTER TABLE [dbo].[DimReseller] ADD | ||
| 1148 | CONSTRAINT [AK_DimReseller_ResellerAlternateKey] UNIQUE NONCLUSTERED | ||
| 1149 | ( | ||
| 1150 | [ResellerAlternateKey] | ||
| 1151 | ) ON [PRIMARY]; | ||
| 1152 | CONSTRAINT [AK_DimReseller_ResellerAlternateKey] UNIQUE NONCLUSTERED 
 | ||
| 1153 | (
 | ||
| 1154 | [ResellerAlternateKey]
 | ||
| 1155 | ) ON [PRIMARY];
 | ||
| 1156 | 
 | ||
| 1157 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 1158 | 64|2010-09-30 11:12:52.780000000|dbo|ALTER_TABLE|dbo|DimSalesTerritory|ALTER TABLE [dbo].[DimSalesTerritory] ADD | ||
| 1159 | CONSTRAINT [AK_DimSalesTerritory_SalesTerritoryAlternateKey] UNIQUE NONCLUSTERED | ||
| 1160 | ( | ||
| 1161 | [SalesTerritoryAlternateKey] | ||
| 1162 | ) ON [PRIMARY]; | ||
| 1163 | CONSTRAINT [AK_DimSalesTerritory_SalesTerritoryAlternateKey] UNIQUE NONCLUSTERED 
 | ||
| 1164 | (
 | ||
| 1165 | [SalesTerritoryAlternateKey]
 | ||
| 1166 | ) ON [PRIMARY];
 | ||
| 1167 | 
 | ||
| 1168 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 1169 | 65|2010-09-30 11:12:52.787000000|dbo|ALTER_TABLE|dbo|DimDate|ALTER TABLE [dbo].[DimDate] ADD | ||
| 1170 | CONSTRAINT [AK_DimDate_FullDateAlternateKey] UNIQUE NONCLUSTERED | ||
| 1171 | ( | ||
| 1172 | [FullDateAlternateKey] | ||
| 1173 | ) ON [PRIMARY]; | ||
| 1174 | CONSTRAINT [AK_DimDate_FullDateAlternateKey] UNIQUE NONCLUSTERED 
 | ||
| 1175 | (
 | ||
| 1176 | [FullDateAlternateKey]
 | ||
| 1177 | ) ON [PRIMARY];
 | ||
| 1178 | 
 | ||
| 1179 | 
 | ||
| 1180 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 1181 | 66|2010-09-30 11:12:52.790000000|dbo|ALTER_TABLE|dbo|FactCallCenter|ALTER TABLE [dbo].[FactCallCenter] ADD | ||
| 1182 | CONSTRAINT [AK_FactCallCenter_DateKey_Shift] UNIQUE NONCLUSTERED | ||
| 1183 | ( | ||
| 1184 | [DateKey], | ||
| 1185 | [Shift] | ||
| 1186 | ) ON [PRIMARY]; | ||
| 1187 | CONSTRAINT [AK_FactCallCenter_DateKey_Shift] UNIQUE NONCLUSTERED
 | ||
| 1188 | (
 | ||
| 1189 | [DateKey],
 | ||
| 1190 | [Shift]
 | ||
| 1191 | ) ON [PRIMARY];
 | ||
| 1192 | 
 | ||
| 1193 | 
 | ||
| 1194 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 1195 | 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]; | ||
| 1196 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 1197 | 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]; | ||
| 1198 | 
 | ||
| 1199 | 
 | ||
| 1200 | 
 | ||
| 1201 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 1202 | 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]; | ||
| 1203 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 1204 | 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]; | ||
| 1205 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 1206 | 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]; | ||
| 1207 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 1208 | 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]; | ||
| 1209 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 1210 | 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]; | ||
| 1211 | |||
| 1212 | 
 | ||
| 1213 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 1214 | 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]; | ||
| 1215 | 
 | ||
| 1216 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 1217 | 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]; | ||
| 1218 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 1219 | 88|2010-09-30 11:12:55.683000000|dbo|ALTER_TABLE|dbo|DimAccount|ALTER TABLE [dbo].[DimAccount] ADD | ||
| 1220 | CONSTRAINT [FK_DimAccount_DimAccount] FOREIGN KEY | ||
| 1221 | ( | ||
| 1222 | [ParentAccountKey] | ||
| 1223 | ) REFERENCES [dbo].[DimAccount] ( | ||
| 1224 | [AccountKey] | ||
| 1225 | ); | ||
| 1226 | CONSTRAINT [FK_DimAccount_DimAccount] FOREIGN KEY 
 | ||
| 1227 | (
 | ||
| 1228 | [ParentAccountKey]
 | ||
| 1229 | ) REFERENCES [dbo].[DimAccount] (
 | ||
| 1230 | [AccountKey]
 | ||
| 1231 | );
 | ||
| 1232 | 
 | ||
| 1233 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 1234 | 89|2010-09-30 11:12:55.697000000|dbo|ALTER_TABLE|dbo|DimCustomer|ALTER TABLE [dbo].[DimCustomer] ADD | ||
| 1235 | CONSTRAINT [FK_DimCustomer_DimGeography] FOREIGN KEY | ||
| 1236 | ( | ||
| 1237 | [GeographyKey] | ||
| 1238 | ) REFERENCES [dbo].[DimGeography] ( | ||
| 1239 | [GeographyKey] | ||
| 1240 | ); | ||
| 1241 | CONSTRAINT [FK_DimCustomer_DimGeography] FOREIGN KEY 
 | ||
| 1242 | (
 | ||
| 1243 | [GeographyKey]
 | ||
| 1244 | ) REFERENCES [dbo].[DimGeography] (
 | ||
| 1245 | [GeographyKey]
 | ||
| 1246 | );
 | ||
| 1247 | 
 | ||
| 1248 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 1249 | 90|2010-09-30 11:12:55.700000000|dbo|ALTER_TABLE|dbo|DimDepartmentGroup|ALTER TABLE [dbo].[DimDepartmentGroup] ADD | ||
| 1250 | CONSTRAINT [FK_DimDepartmentGroup_DimDepartmentGroup] FOREIGN KEY | ||
| 1251 | ( | ||
| 1252 | [ParentDepartmentGroupKey] | ||
| 1253 | ) REFERENCES [dbo].[DimDepartmentGroup] ( | ||
| 1254 | [DepartmentGroupKey] | ||
| 1255 | ); | ||
| 1256 | CONSTRAINT [FK_DimDepartmentGroup_DimDepartmentGroup] FOREIGN KEY 
 | ||
| 1257 | (
 | ||
| 1258 | [ParentDepartmentGroupKey]
 | ||
| 1259 | ) REFERENCES [dbo].[DimDepartmentGroup] (
 | ||
| 1260 | [DepartmentGroupKey]
 | ||
| 1261 | );
 | ||
| 1262 | 
 | ||
| 1263 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 1264 | 91|2010-09-30 11:12:55.707000000|dbo|ALTER_TABLE|dbo|DimEmployee|ALTER TABLE [dbo].[DimEmployee] ADD | ||
| 1265 | CONSTRAINT [FK_DimEmployee_DimEmployee] FOREIGN KEY | ||
| 1266 | ( | ||
| 1267 | [ParentEmployeeKey] | ||
| 1268 | ) REFERENCES [dbo].[DimEmployee] ( | ||
| 1269 | [EmployeeKey] | ||
| 1270 | ), | ||
| 1271 | CONSTRAINT [FK_DimEmployee_DimSalesTerritory] FOREIGN KEY | ||
| 1272 | ( | ||
| 1273 | [SalesTerritoryKey] | ||
| 1274 | ) REFERENCES [dbo].[DimSalesTerritory] ( | ||
| 1275 | [SalesTerritoryKey] | ||
| 1276 | ); | ||
| 1277 | CONSTRAINT [FK_DimEmployee_DimEmployee] FOREIGN KEY 
 | ||
| 1278 | (
 | ||
| 1279 | [ParentEmployeeKey]
 | ||
| 1280 | ) REFERENCES [dbo].[DimEmployee] (
 | ||
| 1281 | [EmployeeKey]
 | ||
| 1282 | ),
 | ||
| 1283 | CONSTRAINT [FK_DimEmployee_DimSalesTerritory] FOREIGN KEY 
 | ||
| 1284 | (
 | ||
| 1285 | [SalesTerritoryKey]
 | ||
| 1286 | ) REFERENCES [dbo].[DimSalesTerritory] (
 | ||
| 1287 | [SalesTerritoryKey]
 | ||
| 1288 | );
 | ||
| 1289 | 
 | ||
| 1290 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 1291 | 92|2010-09-30 11:12:55.710000000|dbo|ALTER_TABLE|dbo|DimGeography|ALTER TABLE [dbo].[DimGeography] ADD | ||
| 1292 | CONSTRAINT [FK_DimGeography_DimSalesTerritory] FOREIGN KEY | ||
| 1293 | ( | ||
| 1294 | [SalesTerritoryKey] | ||
| 1295 | ) REFERENCES [dbo].[DimSalesTerritory] ( | ||
| 1296 | [SalesTerritoryKey] | ||
| 1297 | ); | ||
| 1298 | CONSTRAINT [FK_DimGeography_DimSalesTerritory] FOREIGN KEY 
 | ||
| 1299 | (
 | ||
| 1300 | [SalesTerritoryKey]
 | ||
| 1301 | ) REFERENCES [dbo].[DimSalesTerritory] (
 | ||
| 1302 | [SalesTerritoryKey]
 | ||
| 1303 | );
 | ||
| 1304 | 
 | ||
| 1305 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 1306 | 93|2010-09-30 11:12:55.717000000|dbo|ALTER_TABLE|dbo|DimOrganization|ALTER TABLE [dbo].[DimOrganization] ADD | ||
| 1307 | CONSTRAINT [FK_DimOrganization_DimOrganization] FOREIGN KEY | ||
| 1308 | ( | ||
| 1309 | [ParentOrganizationKey] | ||
| 1310 | ) REFERENCES [dbo].[DimOrganization] ( | ||
| 1311 | [OrganizationKey] | ||
| 1312 | ), | ||
| 1313 | CONSTRAINT [FK_DimOrganization_DimCurrency] FOREIGN KEY | ||
| 1314 | ( | ||
| 1315 | [CurrencyKey] | ||
| 1316 | ) REFERENCES [dbo].[DimCurrency] ( | ||
| 1317 | [CurrencyKey] | ||
| 1318 | ); | ||
| 1319 | CONSTRAINT [FK_DimOrganization_DimOrganization] FOREIGN KEY 
 | ||
| 1320 | (
 | ||
| 1321 | [ParentOrganizationKey]
 | ||
| 1322 | ) REFERENCES [dbo].[DimOrganization] (
 | ||
| 1323 | [OrganizationKey]
 | ||
| 1324 | ),
 | ||
| 1325 | CONSTRAINT [FK_DimOrganization_DimCurrency] FOREIGN KEY
 | ||
| 1326 | (
 | ||
| 1327 | [CurrencyKey]
 | ||
| 1328 | ) REFERENCES [dbo].[DimCurrency] (
 | ||
| 1329 | [CurrencyKey]
 | ||
| 1330 | );
 | ||
| 1331 | 
 | ||
| 1332 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 1333 | 94|2010-09-30 11:12:55.720000000|dbo|ALTER_TABLE|dbo|DimProduct|ALTER TABLE [dbo].[DimProduct] ADD | ||
| 1334 | CONSTRAINT [FK_DimProduct_DimProductSubcategory] FOREIGN KEY | ||
| 1335 | ( | ||
| 1336 | [ProductSubcategoryKey] | ||
| 1337 | ) REFERENCES [dbo].[DimProductSubcategory] ( | ||
| 1338 | [ProductSubcategoryKey] | ||
| 1339 | ); | ||
| 1340 | CONSTRAINT [FK_DimProduct_DimProductSubcategory] FOREIGN KEY 
 | ||
| 1341 | (
 | ||
| 1342 | [ProductSubcategoryKey]
 | ||
| 1343 | ) REFERENCES [dbo].[DimProductSubcategory] (
 | ||
| 1344 | [ProductSubcategoryKey]
 | ||
| 1345 | );
 | ||
| 1346 | 
 | ||
| 1347 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 1348 | 95|2010-09-30 11:12:55.727000000|dbo|ALTER_TABLE|dbo|DimProductSubcategory|ALTER TABLE [dbo].[DimProductSubcategory] ADD | ||
| 1349 | CONSTRAINT [FK_DimProductSubcategory_DimProductCategory] FOREIGN KEY | ||
| 1350 | ( | ||
| 1351 | [ProductCategoryKey] | ||
| 1352 | ) REFERENCES [dbo].[DimProductCategory] ( | ||
| 1353 | [ProductCategoryKey] | ||
| 1354 | ); | ||
| 1355 | CONSTRAINT [FK_DimProductSubcategory_DimProductCategory] FOREIGN KEY 
 | ||
| 1356 | (
 | ||
| 1357 | [ProductCategoryKey]
 | ||
| 1358 | ) REFERENCES [dbo].[DimProductCategory] (
 | ||
| 1359 | [ProductCategoryKey]
 | ||
| 1360 | );
 | ||
| 1361 | 
 | ||
| 1362 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 1363 | 96|2010-09-30 11:12:55.733000000|dbo|ALTER_TABLE|dbo|DimReseller|ALTER TABLE [dbo].[DimReseller] ADD | ||
| 1364 | CONSTRAINT [FK_DimReseller_DimGeography] FOREIGN KEY | ||
| 1365 | ( | ||
| 1366 | [GeographyKey] | ||
| 1367 | ) REFERENCES [dbo].[DimGeography] ( | ||
| 1368 | [GeographyKey] | ||
| 1369 | ); | ||
| 1370 | |||
| 1371 | CONSTRAINT [FK_DimReseller_DimGeography] FOREIGN KEY 
 | ||
| 1372 | (
 | ||
| 1373 | [GeographyKey]
 | ||
| 1374 | ) REFERENCES [dbo].[DimGeography] (
 | ||
| 1375 | [GeographyKey]
 | ||
| 1376 | );
 | ||
| 1377 | 
 | ||
| 1378 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 1379 | 97|2010-09-30 11:12:55.737000000|dbo|ALTER_TABLE|dbo|FactCallCenter|ALTER TABLE [dbo].[FactCallCenter] ADD | ||
| 1380 | CONSTRAINT [FK_FactCallCenter_DimDate] FOREIGN KEY | ||
| 1381 | ( | ||
| 1382 | [DateKey] | ||
| 1383 | ) REFERENCES [dbo].[DimDate] ( | ||
| 1384 | [DateKey] | ||
| 1385 | ); | ||
| 1386 | CONSTRAINT [FK_FactCallCenter_DimDate] FOREIGN KEY
 | ||
| 1387 | (
 | ||
| 1388 | [DateKey]
 | ||
| 1389 | ) REFERENCES [dbo].[DimDate] (
 | ||
| 1390 | [DateKey]
 | ||
| 1391 | );
 | ||
| 1392 | 
 | ||
| 1393 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 1394 | 98|2010-09-30 11:12:55.773000000|dbo|ALTER_TABLE|dbo|FactCurrencyRate|ALTER TABLE [dbo].[FactCurrencyRate] ADD | ||
| 1395 | CONSTRAINT [FK_FactCurrencyRate_DimDate] FOREIGN KEY | ||
| 1396 | ( | ||
| 1397 | [DateKey] | ||
| 1398 | ) REFERENCES [dbo].[DimDate] ( | ||
| 1399 | [DateKey] | ||
| 1400 | ), | ||
| 1401 | CONSTRAINT [FK_FactCurrencyRate_DimCurrency] FOREIGN KEY | ||
| 1402 | ( | ||
| 1403 | [CurrencyKey] | ||
| 1404 | ) REFERENCES [dbo].[DimCurrency] ( | ||
| 1405 | [CurrencyKey] | ||
| 1406 | ); | ||
| 1407 | CONSTRAINT [FK_FactCurrencyRate_DimDate] FOREIGN KEY 
 | ||
| 1408 | (
 | ||
| 1409 | [DateKey]
 | ||
| 1410 | ) REFERENCES [dbo].[DimDate] (
 | ||
| 1411 | [DateKey]
 | ||
| 1412 | ),
 | ||
| 1413 | CONSTRAINT [FK_FactCurrencyRate_DimCurrency] FOREIGN KEY 
 | ||
| 1414 | (
 | ||
| 1415 | [CurrencyKey]
 | ||
| 1416 | ) REFERENCES [dbo].[DimCurrency] (
 | ||
| 1417 | [CurrencyKey]
 | ||
| 1418 | );
 | ||
| 1419 | 
 | ||
| 1420 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 1421 | 99|2010-09-30 11:12:55.983000000|dbo|ALTER_TABLE|dbo|FactFinance|ALTER TABLE [dbo].[FactFinance] ADD | ||
| 1422 | CONSTRAINT [FK_FactFinance_DimAccount] FOREIGN KEY | ||
| 1423 | ( | ||
| 1424 | [AccountKey] | ||
| 1425 | ) REFERENCES [dbo].[DimAccount] ( | ||
| 1426 | [AccountKey] | ||
| 1427 | ), | ||
| 1428 | CONSTRAINT [FK_FactFinance_DimDepartmentGroup] FOREIGN KEY | ||
| 1429 | ( | ||
| 1430 | [DepartmentGroupKey] | ||
| 1431 | ) REFERENCES [dbo].[DimDepartmentGroup] ( | ||
| 1432 | [DepartmentGroupKey] | ||
| 1433 | ), | ||
| 1434 | CONSTRAINT [FK_FactFinance_DimOrganization] FOREIGN KEY | ||
| 1435 | ( | ||
| 1436 | [OrganizationKey] | ||
| 1437 | ) REFERENCES [dbo].[DimOrganization] ( | ||
| 1438 | [OrganizationKey] | ||
| 1439 | ), | ||
| 1440 | CONSTRAINT [FK_FactFinance_DimScenario] FOREIGN KEY | ||
| 1441 | ( | ||
| 1442 | [ScenarioKey] | ||
| 1443 | ) REFERENCES [dbo].[DimScenario] ( | ||
| 1444 | [ScenarioKey] | ||
| 1445 | ), | ||
| 1446 | CONSTRAINT [FK_FactFinance_DimDate] FOREIGN KEY | ||
| 1447 | ( | ||
| 1448 | [DateKey] | ||
| 1449 | ) REFERENCES [dbo].[DimDate] ( | ||
| 1450 | [DateKey] | ||
| 1451 | ); | ||
| 1452 | CONSTRAINT [FK_FactFinance_DimAccount] FOREIGN KEY 
 | ||
| 1453 | (
 | ||
| 1454 | [AccountKey]
 | ||
| 1455 | ) REFERENCES [dbo].[DimAccount] (
 | ||
| 1456 | [AccountKey]
 | ||
| 1457 | ),
 | ||
| 1458 | CONSTRAINT [FK_FactFinance_DimDepartmentGroup] FOREIGN KEY 
 | ||
| 1459 | (
 | ||
| 1460 | [DepartmentGroupKey]
 | ||
| 1461 | ) REFERENCES [dbo].[DimDepartmentGroup] (
 | ||
| 1462 | [DepartmentGroupKey]
 | ||
| 1463 | ),
 | ||
| 1464 | CONSTRAINT [FK_FactFinance_DimOrganization] FOREIGN KEY 
 | ||
| 1465 | (
 | ||
| 1466 | [OrganizationKey]
 | ||
| 1467 | ) REFERENCES [dbo].[DimOrganization] (
 | ||
| 1468 | [OrganizationKey]
 | ||
| 1469 | ),
 | ||
| 1470 | CONSTRAINT [FK_FactFinance_DimScenario] FOREIGN KEY 
 | ||
| 1471 | (
 | ||
| 1472 | [ScenarioKey]
 | ||
| 1473 | ) REFERENCES [dbo].[DimScenario] (
 | ||
| 1474 | [ScenarioKey]
 | ||
| 1475 | ),
 | ||
| 1476 | CONSTRAINT [FK_FactFinance_DimDate] FOREIGN KEY 
 | ||
| 1477 | (
 | ||
| 1478 | [DateKey]
 | ||
| 1479 | ) REFERENCES [dbo].[DimDate] (
 | ||
| 1480 | [DateKey]
 | ||
| 1481 | );
 | ||
| 1482 | 
 | ||
| 1483 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 1484 | 100|2010-09-30 11:12:56.313000000|dbo|ALTER_TABLE|dbo|FactInternetSalesReason|ALTER TABLE [dbo].[FactInternetSalesReason] ADD | ||
| 1485 | CONSTRAINT [FK_FactInternetSalesReason_DimSalesReason] FOREIGN KEY | ||
| 1486 | ( | ||
| 1487 | [SalesReasonKey] | ||
| 1488 | ) REFERENCES [dbo].[DimSalesReason] ( | ||
| 1489 | [SalesReasonKey] | ||
| 1490 | ), | ||
| 1491 | CONSTRAINT [FK_FactInternetSalesReason_FactInternetSales] FOREIGN KEY | ||
| 1492 | ( | ||
| 1493 | [SalesOrderNumber], | ||
| 1494 | [SalesOrderLineNumber] | ||
| 1495 | ) REFERENCES [dbo].[FactInternetSales] ( | ||
| 1496 | [SalesOrderNumber], | ||
| 1497 | [SalesOrderLineNumber] | ||
| 1498 | ); | ||
| 1499 | CONSTRAINT [FK_FactInternetSalesReason_DimSalesReason] FOREIGN KEY 
 | ||
| 1500 | (
 | ||
| 1501 | [SalesReasonKey]
 | ||
| 1502 | ) REFERENCES [dbo].[DimSalesReason] (
 | ||
| 1503 | [SalesReasonKey]
 | ||
| 1504 | ),
 | ||
| 1505 | CONSTRAINT [FK_FactInternetSalesReason_FactInternetSales] FOREIGN KEY 
 | ||
| 1506 | (
 | ||
| 1507 | [SalesOrderNumber],
 | ||
| 1508 | [SalesOrderLineNumber]
 | ||
| 1509 | ) REFERENCES [dbo].[FactInternetSales] (
 | ||
| 1510 | [SalesOrderNumber],
 | ||
| 1511 | [SalesOrderLineNumber]
 | ||
| 1512 | );
 | ||
| 1513 | 
 | ||
| 1514 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 1515 | 103|2010-09-30 11:12:56.763000000|dbo|ALTER_TABLE|dbo|FactSalesQuota|ALTER TABLE [dbo].[FactSalesQuota] ADD | ||
| 1516 | CONSTRAINT [FK_FactSalesQuota_DimEmployee] FOREIGN KEY | ||
| 1517 | ( | ||
| 1518 | [EmployeeKey] | ||
| 1519 | ) REFERENCES [dbo].[DimEmployee] ( | ||
| 1520 | [EmployeeKey] | ||
| 1521 | ), | ||
| 1522 | CONSTRAINT [FK_FactSalesQuota_DimDate] FOREIGN KEY | ||
| 1523 | ( | ||
| 1524 | [DateKey] | ||
| 1525 | ) REFERENCES [dbo].[DimDate] ( | ||
| 1526 | [DateKey] | ||
| 1527 | ); | ||
| 1528 | CONSTRAINT [FK_FactSalesQuota_DimEmployee] FOREIGN KEY 
 | ||
| 1529 | (
 | ||
| 1530 | [EmployeeKey]
 | ||
| 1531 | ) REFERENCES [dbo].[DimEmployee] (
 | ||
| 1532 | [EmployeeKey]
 | ||
| 1533 | ),
 | ||
| 1534 | CONSTRAINT [FK_FactSalesQuota_DimDate] FOREIGN KEY 
 | ||
| 1535 | (
 | ||
| 1536 | [DateKey]
 | ||
| 1537 | ) REFERENCES [dbo].[DimDate] (
 | ||
| 1538 | [DateKey]
 | ||
| 1539 | );
 | ||
| 1540 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 1541 | 101|2010-09-30 11:12:56.540000000|dbo|ALTER_TABLE|dbo|FactInternetSales|ALTER TABLE [dbo].[FactInternetSales] ADD | ||
| 1542 | CONSTRAINT [FK_FactInternetSales_DimCurrency] FOREIGN KEY | ||
| 1543 | ( | ||
| 1544 | [CurrencyKey] | ||
| 1545 | ) REFERENCES [dbo].[DimCurrency] ( | ||
| 1546 | [CurrencyKey] | ||
| 1547 | ), | ||
| 1548 | CONSTRAINT [FK_FactInternetSales_DimCustomer] FOREIGN KEY | ||
| 1549 | ( | ||
| 1550 | [CustomerKey] | ||
| 1551 | ) REFERENCES [dbo].[DimCustomer] ( | ||
| 1552 | [CustomerKey] | ||
| 1553 | ), | ||
| 1554 | CONSTRAINT [FK_FactInternetSales_DimProduct] FOREIGN KEY | ||
| 1555 | ( | ||
| 1556 | [ProductKey] | ||
| 1557 | ) REFERENCES [dbo].[DimProduct] ( | ||
| 1558 | [ProductKey] | ||
| 1559 | ), | ||
| 1560 | CONSTRAINT [FK_FactInternetSales_DimPromotion] FOREIGN KEY | ||
| 1561 | ( | ||
| 1562 | [PromotionKey] | ||
| 1563 | ) REFERENCES [dbo].[DimPromotion] ( | ||
| 1564 | [PromotionKey] | ||
| 1565 | ), | ||
| 1566 | CONSTRAINT [FK_FactInternetSales_DimDate] FOREIGN KEY | ||
| 1567 | ( | ||
| 1568 | [OrderDateKey] | ||
| 1569 | ) REFERENCES [dbo].[DimDate] ( | ||
| 1570 | [DateKey] | ||
| 1571 | ), | ||
| 1572 | CONSTRAINT [FK_FactInternetSales_DimDate1] FOREIGN KEY | ||
| 1573 | ( | ||
| 1574 | [DueDateKey] | ||
| 1575 | ) REFERENCES [dbo].[DimDate] ( | ||
| 1576 | [DateKey] | ||
| 1577 | ), | ||
| 1578 | CONSTRAINT [FK_FactInternetSales_DimDate2] FOREIGN KEY | ||
| 1579 | ( | ||
| 1580 | [ShipDateKey] | ||
| 1581 | ) REFERENCES [dbo].[DimDate] ( | ||
| 1582 | [DateKey] | ||
| 1583 | ), | ||
| 1584 | CONSTRAINT [FK_FactInternetSales_DimSalesTerritory] FOREIGN KEY | ||
| 1585 | ( | ||
| 1586 | [SalesTerritoryKey] | ||
| 1587 | ) REFERENCES [dbo].[DimSalesTerritory] ( | ||
| 1588 | [SalesTerritoryKey] | ||
| 1589 | ); | ||
| 1590 | CONSTRAINT [FK_FactInternetSales_DimCurrency] FOREIGN KEY 
 | ||
| 1591 | (
 | ||
| 1592 | [CurrencyKey]
 | ||
| 1593 | ) REFERENCES [dbo].[DimCurrency] (
 | ||
| 1594 | [CurrencyKey]
 | ||
| 1595 | ),
 | ||
| 1596 | CONSTRAINT [FK_FactInternetSales_DimCustomer] FOREIGN KEY 
 | ||
| 1597 | (
 | ||
| 1598 | [CustomerKey]
 | ||
| 1599 | ) REFERENCES [dbo].[DimCustomer] (
 | ||
| 1600 | [CustomerKey]
 | ||
| 1601 | ),
 | ||
| 1602 | CONSTRAINT [FK_FactInternetSales_DimProduct] FOREIGN KEY 
 | ||
| 1603 | (
 | ||
| 1604 | [ProductKey]
 | ||
| 1605 | ) REFERENCES [dbo].[DimProduct] (
 | ||
| 1606 | [ProductKey]
 | ||
| 1607 | ),
 | ||
| 1608 | CONSTRAINT [FK_FactInternetSales_DimPromotion] FOREIGN KEY 
 | ||
| 1609 | (
 | ||
| 1610 | [PromotionKey]
 | ||
| 1611 | ) REFERENCES [dbo].[DimPromotion] (
 | ||
| 1612 | [PromotionKey]
 | ||
| 1613 | ),
 | ||
| 1614 | CONSTRAINT [FK_FactInternetSales_DimDate] FOREIGN KEY 
 | ||
| 1615 | (
 | ||
| 1616 | [OrderDateKey]
 | ||
| 1617 | ) REFERENCES [dbo].[DimDate] (
 | ||
| 1618 | [DateKey]
 | ||
| 1619 | ),
 | ||
| 1620 | CONSTRAINT [FK_FactInternetSales_DimDate1] FOREIGN KEY 
 | ||
| 1621 | (
 | ||
| 1622 | [DueDateKey]
 | ||
| 1623 | ) REFERENCES [dbo].[DimDate] (
 | ||
| 1624 | [DateKey]
 | ||
| 1625 | ),
 | ||
| 1626 | CONSTRAINT [FK_FactInternetSales_DimDate2] FOREIGN KEY 
 | ||
| 1627 | (
 | ||
| 1628 | [ShipDateKey]
 | ||
| 1629 | ) REFERENCES [dbo].[DimDate] (
 | ||
| 1630 | [DateKey]
 | ||
| 1631 | ),
 | ||
| 1632 | CONSTRAINT [FK_FactInternetSales_DimSalesTerritory] FOREIGN KEY 
 | ||
| 1633 | (
 | ||
| 1634 | [SalesTerritoryKey]
 | ||
| 1635 | ) REFERENCES [dbo].[DimSalesTerritory] (
 | ||
| 1636 | [SalesTerritoryKey]
 | ||
| 1637 | );
 | ||
| 1638 | 
 | ||
| 1639 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 1640 | 102|2010-09-30 11:12:56.753000000|dbo|ALTER_TABLE|dbo|FactResellerSales|ALTER TABLE [dbo].[FactResellerSales] ADD | ||
| 1641 | CONSTRAINT [FK_FactResellerSales_DimCurrency] FOREIGN KEY | ||
| 1642 | ( | ||
| 1643 | [CurrencyKey] | ||
| 1644 | ) REFERENCES [dbo].[DimCurrency] ( | ||
| 1645 | [CurrencyKey] | ||
| 1646 | ), | ||
| 1647 | CONSTRAINT [FK_FactResellerSales_DimProduct] FOREIGN KEY | ||
| 1648 | ( | ||
| 1649 | [ProductKey] | ||
| 1650 | ) REFERENCES [dbo].[DimProduct] ( | ||
| 1651 | [ProductKey] | ||
| 1652 | ), | ||
| 1653 | CONSTRAINT [FK_FactResellerSales_DimPromotion] FOREIGN KEY | ||
| 1654 | ( | ||
| 1655 | [PromotionKey] | ||
| 1656 | ) REFERENCES [dbo].[DimPromotion] ( | ||
| 1657 | [PromotionKey] | ||
| 1658 | ), | ||
| 1659 | CONSTRAINT [FK_FactResellerSales_DimDate] FOREIGN KEY | ||
| 1660 | ( | ||
| 1661 | [OrderDateKey] | ||
| 1662 | ) REFERENCES [dbo].[DimDate] ( | ||
| 1663 | [DateKey] | ||
| 1664 | ), | ||
| 1665 | CONSTRAINT [FK_FactResellerSales_DimDate1] FOREIGN KEY | ||
| 1666 | ( | ||
| 1667 | [DueDateKey] | ||
| 1668 | ) REFERENCES [dbo].[DimDate] ( | ||
| 1669 | [DateKey] | ||
| 1670 | ), | ||
| 1671 | CONSTRAINT [FK_FactResellerSales_DimDate2] FOREIGN KEY | ||
| 1672 | ( | ||
| 1673 | [ShipDateKey] | ||
| 1674 | ) REFERENCES [dbo].[DimDate] ( | ||
| 1675 | [DateKey] | ||
| 1676 | ), | ||
| 1677 | CONSTRAINT [FK_FactResellerSales_DimEmployee] FOREIGN KEY | ||
| 1678 | ( | ||
| 1679 | [EmployeeKey] | ||
| 1680 | ) REFERENCES [dbo].[DimEmployee] ( | ||
| 1681 | [EmployeeKey] | ||
| 1682 | ), | ||
| 1683 | CONSTRAINT [FK_FactResellerSales_DimReseller] FOREIGN KEY | ||
| 1684 | ( | ||
| 1685 | [ResellerKey] | ||
| 1686 | ) REFERENCES [dbo].[DimReseller] ( | ||
| 1687 | [ResellerKey] | ||
| 1688 | ), | ||
| 1689 | CONSTRAINT [FK_FactResellerSales_DimSalesTerritory] FOREIGN KEY | ||
| 1690 | ( | ||
| 1691 | [SalesTerritoryKey] | ||
| 1692 | ) REFERENCES [dbo].[DimSalesTerritory] ( | ||
| 1693 | [SalesTerritoryKey] | ||
| 1694 | ); | ||
| 1695 | CONSTRAINT [FK_FactResellerSales_DimCurrency] FOREIGN KEY 
 | ||
| 1696 | (
 | ||
| 1697 | [CurrencyKey]
 | ||
| 1698 | ) REFERENCES [dbo].[DimCurrency] (
 | ||
| 1699 | [CurrencyKey]
 | ||
| 1700 | ),
 | ||
| 1701 | CONSTRAINT [FK_FactResellerSales_DimProduct] FOREIGN KEY 
 | ||
| 1702 | (
 | ||
| 1703 | [ProductKey]
 | ||
| 1704 | ) REFERENCES [dbo].[DimProduct] (
 | ||
| 1705 | [ProductKey]
 | ||
| 1706 | ),
 | ||
| 1707 | CONSTRAINT [FK_FactResellerSales_DimPromotion] FOREIGN KEY 
 | ||
| 1708 | (
 | ||
| 1709 | [PromotionKey]
 | ||
| 1710 | ) REFERENCES [dbo].[DimPromotion] (
 | ||
| 1711 | [PromotionKey]
 | ||
| 1712 | ),
 | ||
| 1713 | CONSTRAINT [FK_FactResellerSales_DimDate] FOREIGN KEY 
 | ||
| 1714 | (
 | ||
| 1715 | [OrderDateKey]
 | ||
| 1716 | ) REFERENCES [dbo].[DimDate] (
 | ||
| 1717 | [DateKey]
 | ||
| 1718 | ),
 | ||
| 1719 | CONSTRAINT [FK_FactResellerSales_DimDate1] FOREIGN KEY 
 | ||
| 1720 | (
 | ||
| 1721 | [DueDateKey]
 | ||
| 1722 | ) REFERENCES [dbo].[DimDate] (
 | ||
| 1723 | [DateKey]
 | ||
| 1724 | ),
 | ||
| 1725 | CONSTRAINT [FK_FactResellerSales_DimDate2] FOREIGN KEY 
 | ||
| 1726 | (
 | ||
| 1727 | [ShipDateKey]
 | ||
| 1728 | ) REFERENCES [dbo].[DimDate] (
 | ||
| 1729 | [DateKey]
 | ||
| 1730 | ),
 | ||
| 1731 | CONSTRAINT [FK_FactResellerSales_DimEmployee] FOREIGN KEY 
 | ||
| 1732 | (
 | ||
| 1733 | [EmployeeKey]
 | ||
| 1734 | ) REFERENCES [dbo].[DimEmployee] (
 | ||
| 1735 | [EmployeeKey]
 | ||
| 1736 | ),
 | ||
| 1737 | CONSTRAINT [FK_FactResellerSales_DimReseller] FOREIGN KEY 
 | ||
| 1738 | (
 | ||
| 1739 | [ResellerKey]
 | ||
| 1740 | ) REFERENCES [dbo].[DimReseller] (
 | ||
| 1741 | [ResellerKey]
 | ||
| 1742 | ),
 | ||
| 1743 | CONSTRAINT [FK_FactResellerSales_DimSalesTerritory] FOREIGN KEY 
 | ||
| 1744 | (
 | ||
| 1745 | [SalesTerritoryKey]
 | ||
| 1746 | ) REFERENCES [dbo].[DimSalesTerritory] (
 | ||
| 1747 | [SalesTerritoryKey]
 | ||
| 1748 | );
 | ||
| 1749 | 
 | ||
| 1750 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 1751 | 104|2010-09-30 11:12:56.797000000|dbo|ALTER_TABLE|dbo|FactSurveyResponse|ALTER TABLE [dbo].[FactSurveyResponse] ADD | ||
| 1752 | CONSTRAINT [FK_FactSurveyResponse_DateKey] FOREIGN KEY | ||
| 1753 | ( | ||
| 1754 | [DateKey] | ||
| 1755 | ) REFERENCES [dbo].[DimDate] ( | ||
| 1756 | [DateKey] | ||
| 1757 | ), | ||
| 1758 | CONSTRAINT [FK_FactSurveyResponse_CustomerKey] FOREIGN KEY | ||
| 1759 | ( | ||
| 1760 | [CustomerKey] | ||
| 1761 | ) REFERENCES [dbo].[DimCustomer] ( | ||
| 1762 | [CustomerKey] | ||
| 1763 | ); | ||
| 1764 | CONSTRAINT [FK_FactSurveyResponse_DateKey] FOREIGN KEY
 | ||
| 1765 | (
 | ||
| 1766 | [DateKey]
 | ||
| 1767 | ) REFERENCES [dbo].[DimDate] (
 | ||
| 1768 | [DateKey]
 | ||
| 1769 | ),
 | ||
| 1770 | CONSTRAINT [FK_FactSurveyResponse_CustomerKey] FOREIGN KEY
 | ||
| 1771 | (
 | ||
| 1772 | [CustomerKey]
 | ||
| 1773 | ) REFERENCES [dbo].[DimCustomer] (
 | ||
| 1774 | [CustomerKey]
 | ||
| 1775 | );
 | ||
| 1776 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 1777 | 105|2010-09-30 11:12:56.800000000|dbo|CREATE_FUNCTION|dbo|udfMinimumDate| | ||
| 1778 | CREATE FUNCTION [dbo].[udfMinimumDate] ( | ||
| 1779 | @x DATETIME, | ||
| 1780 | @y DATETIME | ||
| 1781 | ) RETURNS DATETIME | ||
| 1782 | AS | ||
| 1783 | BEGIN | ||
| 1784 | DECLARE @z DATETIME | ||
| 1785 | IF @x <= @y | ||
| 1786 | SET @z = @x | ||
| 1787 | ELSE | ||
| 1788 | SET @z = @y | ||
| 1789 | RETURN(@z) | ||
| 1790 | END | ||
| 1791 | CREATE FUNCTION [dbo].[udfMinimumDate] (
 | ||
| 1792 | @x DATETIME, 
 | ||
| 1793 | @y DATETIME
 | ||
| 1794 | ) RETURNS DATETIME
 | ||
| 1795 | AS
 | ||
| 1796 | BEGIN
 | ||
| 1797 | DECLARE @z DATETIME
 | ||
| 1798 | 
 | ||
| 1799 | IF @x <= @y 
 | ||
| 1800 | SET @z = @x 
 | ||
| 1801 | ELSE 
 | ||
| 1802 | SET @z = @y
 | ||
| 1803 | 
 | ||
| 1804 | RETURN(@z)
 | ||
| 1805 | END
 | ||
| 1806 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 1807 | 106|2010-09-30 11:12:56.813000000|dbo|CREATE_FUNCTION|dbo|udfTwoDigitZeroFill| | ||
| 1808 | -- Converts the specified integer (which should be < 100 and > -1) | ||
| 1809 | -- into a two character string, zero filling from the left | ||
| 1810 | -- if the number is < 10. | ||
| 1811 | CREATE FUNCTION [dbo].[udfTwoDigitZeroFill] (@number int) | ||
| 1812 | RETURNS char(2) | ||
| 1813 | AS | ||
| 1814 | BEGIN | ||
| 1815 | DECLARE @result char(2); | ||
| 1816 | IF @number > 9 | ||
| 1817 | SET @result = convert(char(2), @number); | ||
| 1818 | ELSE | ||
| 1819 | SET @result = convert(char(2), '0' + convert(varchar, @number)); | ||
| 1820 | RETURN @result; | ||
| 1821 | END | ||
| 1822 | -- Converts the specified integer (which should be < 100 and > -1)
 | ||
| 1823 | -- into a two character string, zero filling from the left 
 | ||
| 1824 | -- if the number is < 10.
 | ||
| 1825 | CREATE FUNCTION [dbo].[udfTwoDigitZeroFill] (@number int) 
 | ||
| 1826 | RETURNS char(2)
 | ||
| 1827 | AS
 | ||
| 1828 | BEGIN
 | ||
| 1829 | DECLARE @result char(2);
 | ||
| 1830 | IF @number > 9 
 | ||
| 1831 | SET @result = convert(char(2), @number);
 | ||
| 1832 | ELSE
 | ||
| 1833 | SET @result = convert(char(2), '0' + convert(varchar, @number));
 | ||
| 1834 | RETURN @result;
 | ||
| 1835 | END
 | ||
| 1836 | 
 | ||
| 1837 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 1838 | 107|2010-09-30 11:12:56.840000000|dbo|CREATE_FUNCTION|dbo|udfBuildISO8601Date| | ||
| 1839 | -- Builds an ISO 8601 format date from a year, month, and day specified as integers. | ||
| 1840 | -- This format of date should parse correctly regardless of SET DATEFORMAT and SET LANGUAGE. | ||
| 1841 | -- See SQL Server Books Online for more details. | ||
| 1842 | CREATE FUNCTION [dbo].[udfBuildISO8601Date] (@year int, @month int, @day int) | ||
| 1843 | RETURNS datetime | ||
| 1844 | AS | ||
| 1845 | BEGIN | ||
| 1846 | RETURN cast(convert(varchar, @year) + '-' + [dbo].[udfTwoDigitZeroFill](@month) | ||
| 1847 | + '-' + [dbo].[udfTwoDigitZeroFill](@day) + 'T00:00:00' | ||
| 1848 | as datetime); | ||
| 1849 | END | ||
| 1850 | -- Builds an ISO 8601 format date from a year, month, and day specified as integers.
 | ||
| 1851 | -- This format of date should parse correctly regardless of SET DATEFORMAT and SET LANGUAGE.
 | ||
| 1852 | -- See SQL Server Books Online for more details.
 | ||
| 1853 | CREATE FUNCTION [dbo].[udfBuildISO8601Date] (@year int, @month int, @day int)
 | ||
| 1854 | RETURNS datetime
 | ||
| 1855 | AS 
 | ||
| 1856 | BEGIN
 | ||
| 1857 | RETURN cast(convert(varchar, @year) + '-' + [dbo].[udfTwoDigitZeroFill](@month) 
 | ||
| 1858 | + '-' + [dbo].[udfTwoDigitZeroFill](@day) + 'T00:00:00' 
 | ||
| 1859 | as datetime);
 | ||
| 1860 | END
 | ||
| 1861 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 1862 | 108|2010-09-30 11:12:56.853000000|dbo|CREATE_VIEW|dbo|vDMPrep| | ||
| 1863 | -- vDMPrep will be used as a data source by the other data mining views. | ||
| 1864 | -- Uses DW data at customer, product, day, etc. granularity and | ||
| 1865 | -- gets region, model, year, month, etc. | ||
| 1866 | CREATE VIEW [dbo].[vDMPrep] | ||
| 1867 | AS | ||
| 1868 | SELECT | ||
| 1869 | pc.[EnglishProductCategoryName] | ||
| 1870 | ,Coalesce(p.[ModelName], p.[EnglishProductName]) AS [Model] | ||
| 1871 | ,c.[CustomerKey] | ||
| 1872 | ,s.[SalesTerritoryGroup] AS [Region] | ||
| 1873 | ,CASE | ||
| 1874 | WHEN Month(GetDate()) < Month(c.[BirthDate]) | ||
| 1875 | THEN DateDiff(yy,c.[BirthDate],GetDate()) - 1 | ||
| 1876 | WHEN Month(GetDate()) = Month(c.[BirthDate]) | ||
| 1877 | AND Day(GetDate()) < Day(c.[BirthDate]) | ||
| 1878 | THEN DateDiff(yy,c.[BirthDate],GetDate()) - 1 | ||
| 1879 | ELSE DateDiff(yy,c.[BirthDate],GetDate()) | ||
| 1880 | END AS [Age] | ||
| 1881 | ,CASE | ||
| 1882 | WHEN c.[YearlyIncome] < 40000 THEN 'Low' | ||
| 1883 | WHEN c.[YearlyIncome] > 60000 THEN 'High' | ||
| 1884 | ELSE 'Moderate' | ||
| 1885 | END AS [IncomeGroup] | ||
| 1886 | ,d.[CalendarYear] | ||
| 1887 | ,d.[FiscalYear] | ||
| 1888 | ,d.[MonthNumberOfYear] AS [Month] | ||
| 1889 | ,f.[SalesOrderNumber] AS [OrderNumber] | ||
| 1890 | ,f.SalesOrderLineNumber AS LineNumber | ||
| 1891 | ,f.OrderQuantity AS Quantity | ||
| 1892 | ,f.ExtendedAmount AS Amount | ||
| 1893 | FROM | ||
| 1894 | [dbo].[FactInternetSales] f | ||
| 1895 | INNER JOIN [dbo].[DimDate] d | ||
| 1896 | ON f.[OrderDateKey] = d.[DateKey] | ||
| 1897 | INNER JOIN [dbo].[DimProduct] p | ||
| 1898 | ON f.[ProductKey] = p.[ProductKey] | ||
| 1899 | INNER JOIN [dbo].[DimProductSubcategory] psc | ||
| 1900 | ON p.[ProductSubcategoryKey] = psc.[ProductSubcategoryKey] | ||
| 1901 | INNER JOIN [dbo].[DimProductCategory] pc | ||
| 1902 | ON psc.[ProductCategoryKey] = pc.[ProductCategoryKey] | ||
| 1903 | INNER JOIN [dbo].[DimCustomer] c | ||
| 1904 | ON f.[CustomerKey] = c.[CustomerKey] | ||
| 1905 | INNER JOIN [dbo].[DimGeography] g | ||
| 1906 | ON c.[GeographyKey] = g.[GeographyKey] | ||
| 1907 | INNER JOIN [dbo].[DimSalesTerritory] s | ||
| 1908 | ON g.[SalesTerritoryKey] = s.[SalesTerritoryKey] | ||
| 1909 | ; | ||
| 1910 | -- vDMPrep will be used as a data source by the other data mining views. 
 | ||
| 1911 | -- Uses DW data at customer, product, day, etc. granularity and
 | ||
| 1912 | -- gets region, model, year, month, etc.
 | ||
| 1913 | CREATE VIEW [dbo].[vDMPrep]
 | ||
| 1914 | AS
 | ||
| 1915 | SELECT
 | ||
| 1916 | pc.[EnglishProductCategoryName]
 | ||
| 1917 | ,Coalesce(p.[ModelName], p.[EnglishProductName]) AS [Model]
 | ||
| 1918 | ,c.[CustomerKey]
 | ||
| 1919 | ,s.[SalesTerritoryGroup] AS [Region]
 | ||
| 1920 | ,CASE
 | ||
| 1921 | WHEN Month(GetDate()) < Month(c.[BirthDate])
 | ||
| 1922 | THEN DateDiff(yy,c.[BirthDate],GetDate()) - 1
 | ||
| 1923 | WHEN Month(GetDate()) = Month(c.[BirthDate])
 | ||
| 1924 | AND Day(GetDate()) < Day(c.[BirthDate])
 | ||
| 1925 | THEN DateDiff(yy,c.[BirthDate],GetDate()) - 1
 | ||
| 1926 | ELSE DateDiff(yy,c.[BirthDate],GetDate())
 | ||
| 1927 | END AS [Age]
 | ||
| 1928 | ,CASE
 | ||
| 1929 | WHEN c.[YearlyIncome] < 40000 THEN 'Low'
 | ||
| 1930 | WHEN c.[YearlyIncome] > 60000 THEN 'High'
 | ||
| 1931 | ELSE 'Moderate'
 | ||
| 1932 | END AS [IncomeGroup]
 | ||
| 1933 | ,d.[CalendarYear]
 | ||
| 1934 | ,d.[FiscalYear]
 | ||
| 1935 | ,d.[MonthNumberOfYear] AS [Month]
 | ||
| 1936 | ,f.[SalesOrderNumber] AS [OrderNumber]
 | ||
| 1937 | ,f.SalesOrderLineNumber AS LineNumber
 | ||
| 1938 | ,f.OrderQuantity AS Quantity
 | ||
| 1939 | ,f.ExtendedAmount AS Amount 
 | ||
| 1940 | FROM
 | ||
| 1941 | [dbo].[FactInternetSales] f
 | ||
| 1942 | INNER JOIN [dbo].[DimDate] d
 | ||
| 1943 | ON f.[OrderDateKey] = d.[DateKey]
 | ||
| 1944 | INNER JOIN [dbo].[DimProduct] p
 | ||
| 1945 | ON f.[ProductKey] = p.[ProductKey]
 | ||
| 1946 | INNER JOIN [dbo].[DimProductSubcategory] psc
 | ||
| 1947 | ON p.[ProductSubcategoryKey] = psc.[ProductSubcategoryKey]
 | ||
| 1948 | INNER JOIN [dbo].[DimProductCategory] pc
 | ||
| 1949 | ON psc.[ProductCategoryKey] = pc.[ProductCategoryKey]
 | ||
| 1950 | INNER JOIN [dbo].[DimCustomer] c
 | ||
| 1951 | ON f.[CustomerKey] = c.[CustomerKey]
 | ||
| 1952 | INNER JOIN [dbo].[DimGeography] g
 | ||
| 1953 | ON c.[GeographyKey] = g.[GeographyKey]
 | ||
| 1954 | INNER JOIN [dbo].[DimSalesTerritory] s
 | ||
| 1955 | ON g.[SalesTerritoryKey] = s.[SalesTerritoryKey] 
 | ||
| 1956 | ;
 | ||
| 1957 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 1958 | 111|2010-09-30 11:12:56.877000000|dbo|CREATE_VIEW|dbo|vAssocSeqOrders| | ||
| 1959 | -- vAssocSeqOrders supports assocation and sequence clustering data mmining models. | ||
| 1960 | -- - Limits data to FY2004. | ||
| 1961 | -- - Creates order case table and line item nested table. | ||
| 1962 | CREATE VIEW [dbo].[vAssocSeqOrders] | ||
| 1963 | AS | ||
| 1964 | SELECT DISTINCT | ||
| 1965 | [OrderNumber] | ||
| 1966 | ,[CustomerKey] | ||
| 1967 | ,[Region] | ||
| 1968 | ,[IncomeGroup] | ||
| 1969 | FROM | ||
| 1970 | [dbo].[vDMPrep] | ||
| 1971 | WHERE | ||
| 1972 | [FiscalYear] = '2004' | ||
| 1973 | -- vAssocSeqOrders supports assocation and sequence clustering data mmining models.
 | ||
| 1974 | -- - Limits data to FY2004.
 | ||
| 1975 | -- - Creates order case table and line item nested table.
 | ||
| 1976 | CREATE VIEW [dbo].[vAssocSeqOrders]
 | ||
| 1977 | AS
 | ||
| 1978 | SELECT DISTINCT
 | ||
| 1979 | [OrderNumber]
 | ||
| 1980 | ,[CustomerKey]
 | ||
| 1981 | ,[Region]
 | ||
| 1982 | ,[IncomeGroup]
 | ||
| 1983 | FROM
 | ||
| 1984 | [dbo].[vDMPrep] 
 | ||
| 1985 | WHERE
 | ||
| 1986 | [FiscalYear] = '2004'
 | ||
| 1987 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 1988 | 109|2010-09-30 11:12:56.867000000|dbo|CREATE_VIEW|dbo|vTimeSeries| | ||
| 1989 | -- vTimeSeries view supports the creation of time series data mining models. | ||
| 1990 | -- - Replaces earlier bike models with successor models. | ||
| 1991 | -- - Abbreviates model names to improve readability in mining model viewer | ||
| 1992 | -- - Concatenates model and region so that table only has one input. | ||
| 1993 | -- - Creates a date field indexed to monthly reporting date for use in prediction. | ||
| 1994 | CREATE VIEW [dbo].[vTimeSeries] | ||
| 1995 | AS | ||
| 1996 | SELECT | ||
| 1997 | CASE [Model] | ||
| 1998 | WHEN 'Mountain-100' THEN 'M200' | ||
| 1999 | WHEN 'Road-150' THEN 'R250' | ||
| 2000 | WHEN 'Road-650' THEN 'R750' | ||
| 2001 | WHEN 'Touring-1000' THEN 'T1000' | ||
| 2002 | ELSE Left([Model], 1) + Right([Model], 3) | ||
| 2003 | END + ' ' + [Region] AS [ModelRegion] | ||
| 2004 | ,(Convert(Integer, [CalendarYear]) * 100) + Convert(Integer, [Month]) AS [TimeIndex] | ||
| 2005 | ,Sum([Quantity]) AS [Quantity] | ||
| 2006 | ,Sum([Amount]) AS [Amount] | ||
| 2007 | ,CalendarYear | ||
| 2008 | ,[Month] | ||
| 2009 | ,[dbo].[udfBuildISO8601Date] ([CalendarYear], [Month], 25) | ||
| 2010 | as ReportingDate | ||
| 2011 | FROM | ||
| 2012 | [dbo].[vDMPrep] | ||
| 2013 | WHERE | ||
| 2014 | [Model] IN ('Mountain-100', 'Mountain-200', 'Road-150', 'Road-250', | ||
| 2015 | 'Road-650', 'Road-750', 'Touring-1000') | ||
| 2016 | GROUP BY | ||
| 2017 | CASE [Model] | ||
| 2018 | WHEN 'Mountain-100' THEN 'M200' | ||
| 2019 | WHEN 'Road-150' THEN 'R250' | ||
| 2020 | WHEN 'Road-650' THEN 'R750' | ||
| 2021 | WHEN 'Touring-1000' THEN 'T1000' | ||
| 2022 | ELSE Left(Model,1) + Right(Model,3) | ||
| 2023 | END + ' ' + [Region] | ||
| 2024 | ,(Convert(Integer, [CalendarYear]) * 100) + Convert(Integer, [Month]) | ||
| 2025 | ,CalendarYear | ||
| 2026 | ,[Month] | ||
| 2027 | ,[dbo].[udfBuildISO8601Date] ([CalendarYear], [Month], 25); | ||
| 2028 | 
 | ||
| 2029 | -- vTimeSeries view supports the creation of time series data mining models.
 | ||
| 2030 | -- - Replaces earlier bike models with successor models.
 | ||
| 2031 | -- - Abbreviates model names to improve readability in mining model viewer
 | ||
| 2032 | -- - Concatenates model and region so that table only has one input.
 | ||
| 2033 | -- - Creates a date field indexed to monthly reporting date for use in prediction.
 | ||
| 2034 | CREATE VIEW [dbo].[vTimeSeries] 
 | ||
| 2035 | AS
 | ||
| 2036 | SELECT 
 | ||
| 2037 | CASE [Model] 
 | ||
| 2038 | WHEN 'Mountain-100' THEN 'M200' 
 | ||
| 2039 | WHEN 'Road-150' THEN 'R250' 
 | ||
| 2040 | WHEN 'Road-650' THEN 'R750' 
 | ||
| 2041 | WHEN 'Touring-1000' THEN 'T1000' 
 | ||
| 2042 | ELSE Left([Model], 1) + Right([Model], 3) 
 | ||
| 2043 | END + ' ' + [Region] AS [ModelRegion] 
 | ||
| 2044 | ,(Convert(Integer, [CalendarYear]) * 100) + Convert(Integer, [Month]) AS [TimeIndex] 
 | ||
| 2045 | ,Sum([Quantity]) AS [Quantity] 
 | ||
| 2046 | ,Sum([Amount]) AS [Amount]
 | ||
| 2047 | ,CalendarYear
 | ||
| 2048 | ,[Month]
 | ||
| 2049 | ,[dbo].[udfBuildISO8601Date] ([CalendarYear], [Month], 25)
 | ||
| 2050 | as ReportingDate
 | ||
| 2051 | FROM 
 | ||
| 2052 | [dbo].[vDMPrep] 
 | ||
| 2053 | WHERE 
 | ||
| 2054 | [Model] IN ('Mountain-100', 'Mountain-200', 'Road-150', 'Road-250', 
 | ||
| 2055 | 'Road-650', 'Road-750', 'Touring-1000') 
 | ||
| 2056 | GROUP BY 
 | ||
| 2057 | CASE [Model] 
 | ||
| 2058 | WHEN 'Mountain-100' THEN 'M200' 
 | ||
| 2059 | WHEN 'Road-150' THEN 'R250' 
 | ||
| 2060 | WHEN 'Road-650' THEN 'R750' 
 | ||
| 2061 | WHEN 'Touring-1000' THEN 'T1000' 
 | ||
| 2062 | ELSE Left(Model,1) + Right(Model,3) 
 | ||
| 2063 | END + ' ' + [Region] 
 | ||
| 2064 | ,(Convert(Integer, [CalendarYear]) * 100) + Convert(Integer, [Month])
 | ||
| 2065 | ,CalendarYear
 | ||
| 2066 | ,[Month]
 | ||
| 2067 | ,[dbo].[udfBuildISO8601Date] ([CalendarYear], [Month], 25);
 | ||
| 2068 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 2069 | 110|2010-09-30 11:12:56.873000000|dbo|CREATE_VIEW|dbo|vTargetMail| | ||
| 2070 | -- vTargetMail supports targeted mailing data model | ||
| 2071 | -- Uses vDMPrep to determine if a customer buys a bike and joins to DimCustomer | ||
| 2072 | CREATE VIEW [dbo].[vTargetMail] | ||
| 2073 | AS | ||
| 2074 | SELECT | ||
| 2075 | c.[CustomerKey], | ||
| 2076 | c.[GeographyKey], | ||
| 2077 | c.[CustomerAlternateKey], | ||
| 2078 | c.[Title], | ||
| 2079 | c.[FirstName], | ||
| 2080 | c.[MiddleName], | ||
| 2081 | c.[LastName], | ||
| 2082 | c.[NameStyle], | ||
| 2083 | c.[BirthDate], | ||
| 2084 | c.[MaritalStatus], | ||
| 2085 | c.[Suffix], | ||
| 2086 | c.[Gender], | ||
| 2087 | c.[EmailAddress], | ||
| 2088 | c.[YearlyIncome], | ||
| 2089 | c.[TotalChildren], | ||
| 2090 | c.[NumberChildrenAtHome], | ||
| 2091 | c.[EnglishEducation], | ||
| 2092 | c.[SpanishEducation], | ||
| 2093 | c.[FrenchEducation], | ||
| 2094 | c.[EnglishOccupation], | ||
| 2095 | c.[SpanishOccupation], | ||
| 2096 | c.[FrenchOccupation], | ||
| 2097 | c.[HouseOwnerFlag], | ||
| 2098 | c.[NumberCarsOwned], | ||
| 2099 | c.[AddressLine1], | ||
| 2100 | c.[AddressLine2], | ||
| 2101 | c.[Phone], | ||
| 2102 | c.[DateFirstPurchase], | ||
| 2103 | c.[CommuteDistance], | ||
| 2104 | x.[Region], | ||
| 2105 | x.[Age], | ||
| 2106 | CASE x.[Bikes] | ||
| 2107 | WHEN 0 THEN 0 | ||
| 2108 | ELSE 1 | ||
| 2109 | END AS [BikeBuyer] | ||
| 2110 | FROM | ||
| 2111 | [dbo].[DimCustomer] c INNER JOIN ( | ||
| 2112 | SELECT | ||
| 2113 | [CustomerKey] | ||
| 2114 | ,[Region] | ||
| 2115 | ,[Age] | ||
| 2116 | ,Sum( | ||
| 2117 | CASE [EnglishProductCategoryName] | ||
| 2118 | WHEN 'Bikes' THEN 1 | ||
| 2119 | ELSE 0 | ||
| 2120 | END) AS [Bikes] | ||
| 2121 | FROM | ||
| 2122 | [dbo].[vDMPrep] | ||
| 2123 | GROUP BY | ||
| 2124 | [CustomerKey] | ||
| 2125 | ,[Region] | ||
| 2126 | ,[Age] | ||
| 2127 | ) AS [x] | ||
| 2128 | ON c.[CustomerKey] = x.[CustomerKey] | ||
| 2129 | ; | ||
| 2130 | -- vTargetMail supports targeted mailing data model
 | ||
| 2131 | -- Uses vDMPrep to determine if a customer buys a bike and joins to DimCustomer
 | ||
| 2132 | CREATE VIEW [dbo].[vTargetMail] 
 | ||
| 2133 | AS
 | ||
| 2134 | SELECT
 | ||
| 2135 | c.[CustomerKey], 
 | ||
| 2136 | c.[GeographyKey], 
 | ||
| 2137 | c.[CustomerAlternateKey], 
 | ||
| 2138 | c.[Title], 
 | ||
| 2139 | c.[FirstName], 
 | ||
| 2140 | c.[MiddleName], 
 | ||
| 2141 | c.[LastName], 
 | ||
| 2142 | c.[NameStyle], 
 | ||
| 2143 | c.[BirthDate], 
 | ||
| 2144 | c.[MaritalStatus], 
 | ||
| 2145 | c.[Suffix], 
 | ||
| 2146 | c.[Gender], 
 | ||
| 2147 | c.[EmailAddress], 
 | ||
| 2148 | c.[YearlyIncome], 
 | ||
| 2149 | c.[TotalChildren], 
 | ||
| 2150 | c.[NumberChildrenAtHome], 
 | ||
| 2151 | c.[EnglishEducation], 
 | ||
| 2152 | c.[SpanishEducation], 
 | ||
| 2153 | c.[FrenchEducation], 
 | ||
| 2154 | c.[EnglishOccupation], 
 | ||
| 2155 | c.[SpanishOccupation], 
 | ||
| 2156 | c.[FrenchOccupation], 
 | ||
| 2157 | c.[HouseOwnerFlag], 
 | ||
| 2158 | c.[NumberCarsOwned], 
 | ||
| 2159 | c.[AddressLine1], 
 | ||
| 2160 | c.[AddressLine2], 
 | ||
| 2161 | c.[Phone], 
 | ||
| 2162 | c.[DateFirstPurchase], 
 | ||
| 2163 | c.[CommuteDistance], 
 | ||
| 2164 | x.[Region], 
 | ||
| 2165 | x.[Age], 
 | ||
| 2166 | CASE x.[Bikes] 
 | ||
| 2167 | WHEN 0 THEN 0 
 | ||
| 2168 | ELSE 1 
 | ||
| 2169 | END AS [BikeBuyer]
 | ||
| 2170 | FROM
 | ||
| 2171 | [dbo].[DimCustomer] c INNER JOIN (
 | ||
| 2172 | SELECT
 | ||
| 2173 | [CustomerKey]
 | ||
| 2174 | ,[Region]
 | ||
| 2175 | ,[Age]
 | ||
| 2176 | ,Sum(
 | ||
| 2177 | CASE [EnglishProductCategoryName] 
 | ||
| 2178 | WHEN 'Bikes' THEN 1 
 | ||
| 2179 | ELSE 0 
 | ||
| 2180 | END) AS [Bikes]
 | ||
| 2181 | FROM
 | ||
| 2182 | [dbo].[vDMPrep] 
 | ||
| 2183 | GROUP BY
 | ||
| 2184 | [CustomerKey]
 | ||
| 2185 | ,[Region]
 | ||
| 2186 | ,[Age]
 | ||
| 2187 | ) AS [x]
 | ||
| 2188 | ON c.[CustomerKey] = x.[CustomerKey]
 | ||
| 2189 | ;
 | ||
| 2190 | </CommandText></TSQLCommand></EVENT_INSTANCE> | ||
| 2191 | 112|2010-09-30 11:12:56.880000000|dbo|CREATE_VIEW|dbo|vAssocSeqLineItems| | ||
| 2192 | CREATE VIEW [dbo].[vAssocSeqLineItems] | ||
| 2193 | AS | ||
| 2194 | SELECT | ||
| 2195 | OrderNumber | ||
| 2196 | ,LineNumber | ||
| 2197 | ,Model | ||
| 2198 | FROM | ||
| 2199 | [dbo].[vDMPrep] | ||
| 2200 | WHERE | ||
| 2201 | FiscalYear = '2004' | ||
| 2202 | ; | ||
| 2203 | CREATE VIEW [dbo].[vAssocSeqLineItems] 
 | ||
| 2204 | AS
 | ||
| 2205 | SELECT
 | ||
| 2206 | OrderNumber
 | ||
| 2207 | ,LineNumber
 | ||
| 2208 | ,Model
 | ||
| 2209 | FROM
 | ||
| 2210 | [dbo].[vDMPrep] 
 | ||
| 2211 | WHERE
 | ||
| 2212 | FiscalYear = '2004'
 | ||
| 2213 | ;
 | ||
| 2214 | </CommandText></TSQLCommand></EVENT_INSTANCE> |