Last active
August 29, 2015 14:01
-
-
Save samlam/3d89240e31170d2060b4 to your computer and use it in GitHub Desktop.
SQL Xml datatype
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
Declare @Sizings XML | |
Select @Sizings = N'<Sizings><SDLC>Early Stage Analysis</SDLC><Estimate>10</Estimate></Sizings><Sizings><SDLC>Approach and Sizing</SDLC><Estimate>100</Estimate></Sizings>' | |
select | |
Estimate = a.b.value('Estimate[1]','numeric(18,6)') | |
,SDLC = a.b.value('SDLC[1]','nvarchar(500)') | |
from @Sizings.nodes('Sizings') a(b) | |
select convert(nvarchar(500),@Sizings.query('data(/Sizings/SDLC)') ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment