asked on
I have a XML field in a column in a MS SQL table.
I am trying to read the value of <updated key="Rule"> which sometimes is shown first, other times second (and other times just not at all!).
Here is an example of my field:
DECLARE @options XML = '<ID>1673671</ID><LastUpdate>2018-10-24 14:05:37.143</LastUpdate><updated key="Directory">+Role+Symbol+</updated><updated key="Rule">+Parameter+</updated>'
SELECT @options.value('updated[1]', 'varchar(1000)') AS ModicationDetails1
SELECT @options.value('updated[2]', 'varchar(1000)') AS ModicationDetails2