Skip to content

Instantly share code, notes, and snippets.

@astannard
Created November 5, 2013 13:59
Show Gist options
  • Save astannard/7319388 to your computer and use it in GitHub Desktop.
Save astannard/7319388 to your computer and use it in GitHub Desktop.
Select XML node data from a column of type XML
SELECT TOP 1 [xmlColumnName].value('(//NodeName)[1]','varchar(max)') AS NameOfData
FROM [TableWithXMLColumn]
WHERE
Id = @id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment