Created
March 19, 2013 02:22
-
-
Save markmo/5193235 to your computer and use it in GitHub Desktop.
Update Parent Key in Hierarchical Set
This file contains 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
UPDATE RetDay.dimProductCategoryHierarchy SET | |
ParentCategoryKey = ( | |
SELECT TOP 1 ProductCategoryMappingKey | |
FROM RetDay.dimProductCategoryHierarchy | |
WHERE ProductCategoryCode = P.ParentCategoryCode | |
AND DETL_RowIsCurrent = 1) | |
FROM RetDay.dimProductCategoryHierarchy P | |
WHERE P.ParentCategoryKey IS NULL | |
AND P.ParentCategoryCode <> ' ' | |
AND P.ParentCategoryCode IS NOT NULL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment