Help with reading xml I am struggling to extract data from an XML file. The file for all intense and purposes looks like this:

&lt;Message&gt;
  &lt;Code&gt;Hello &lt;/Code&gt;
  &lt;Code&gt;bye &lt;/Code&gt;
&lt;/Message&gt;


At the moment I am using the Value function.

However the data I get returned is only ever "Hello". How do I return all data in a tabular format, like so:
If your question is about MS-Sql you can use this syntax:




DECLARE @data xml;

SET @data = 
'&lt;Message&gt;
  &lt;Code&gt;Hello &lt;/Code&gt;
  &lt;Code&gt;bye &lt;/Code&gt;
&lt;/Message&gt;';

SELECT d.lin.value('.', 'varchar(100)') as [Code]
FROM   @data.nodes('Message/Code') d(lin)
GO



| Code   |
| :----- |
| Hello  |
| bye    |



dbfiddle here