Created
August 11, 2019 01:16
-
-
Save bifacil/f2d6634d6e8d0d0acc4d13e1573bdbfb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Elimino la tabla y la vuelvo a cargar (así es más fácil) :-) | |
DELETE FROM dwh.DimProducts | |
-- Vaaaaaaamos allá. | |
INSERT dwh.DimProducts(ProductID,Product,ProductCategory,ProductSubCategory,ProductNumber,ProductModel,Color,StandardCost,ListPrice,Size,SizeUnitMeasureCode,Weight,WeightUnitMeasureCode,ProductLine,DiscontinuedDate,MakeFlag,FinishedGoodsFlag) | |
SELECT | |
ProductID, | |
Product.Name AS Product, | |
ProductCategory.name AS ProductCategory, | |
ProductSubCategory.name AS ProductSubCategory, | |
ProductNumber, | |
ProductModel.name AS ProductModel, | |
Color, | |
StandardCost, | |
ListPrice, | |
Size, | |
SizeUnitMeasureCode, | |
Weight, | |
WeightUnitMeasureCode, | |
ProductLine, | |
DiscontinuedDate, | |
MakeFlag, | |
FinishedGoodsFlag | |
FROM staging.Product | |
LEFT JOIN staging.ProductSubCategory ON (Product.ProductSubcategoryID=ProductSubCategory.ProductSubcategoryID) | |
LEFT JOIN staging.ProductCategory ON (ProductSubCategory.ProductCategoryId=ProductCategory.ProductCategoryId) | |
LEFT JOIN staging.ProductModel ON (Product.ProductModelID=ProductModel.ProductModelID) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment