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
Experts Exchange (EE) has become my company's go-to resource to get answers. I've used EE to make decisions, solve problems and even save customers. OutagesIO has been a challenging project and... Keep reading >>
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Most Valuable Expert award recognizes technology experts who passionately share their knowledge with the community, demonstrate the core values of this platform, and go the extra mile in all aspects of their contributions. This award is based off of nominations by EE users and experts. Multiple MVEs may be awarded each year.
The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.