select A.*, b.X from A cross apply dbo.UDF(A.Val) b
<song> <title>Some Song</title> <section> <name>Chorus</name> <line>A line of lyrics</line> <line>A second line of lyrics</line> . . . </section> . . . </song>
select SongId ,Lyric = T.c.value('.','varchar(max)') from SongExtended cross apply Lyrics.nodes('/song/section/line') T(c) where 1=1 and Lyrics is not null
ScrewTurn Wiki version 3.0.1.400. Some of the icons created by FamFamFam. Except where noted, all contents Copyright © 1999-2024, Patrick Jasinski.