Created
July 10, 2012 16:18
-
-
Save vadimii/3084424 to your computer and use it in GitHub Desktop.
Extract tags for row from YAML XML column
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
create view ProjectDescriptionSectionTags | |
as select | |
pds.ProjectID, | |
cs.ID as SectionID, | |
U.V.value('./text()[1]', 'nvarchar(100)') as Tag | |
from ProjectDescriptionSection pds | |
inner join ContentSection cs on cs.ID = pds.ID | |
cross apply cs.XmlConf.nodes(N'//key') as T(K) | |
cross apply T.K.nodes('../value/sequence/item') as U(V) | |
where T.K.exist('.="tags"') = 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment