A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
Hi @Bobby P ,
Here is how to do much simpler.
SQL
DECLARE @xml XML =
N'<root>
<r>
<Section>Section text<Content>Content Text</Content></Section>
</r>
<r>
<Section>
<Content>2nd Content Text</Content>
</Section>
</r>
</root>';
SELECT CONCAT('WARNING: ' + c.value('(Section/text())[1]', 'VARCHAR(30)') + SPACE(1)
, 'COMMON USES: ', c.value('(Section/Content/text())[1]', 'VARCHAR(30)')) AS result
FROM @xml.nodes('/root/r') AS t(c);
Output
+-------------------------------------------------+
| result |
+-------------------------------------------------+
| WARNING: Section text COMMON USES: Content Text |
| COMMON USES: 2nd Content Text |
+-------------------------------------------------+