Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- 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)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement