I'm trying to figure out how to get an XML attributes value when the element name changes. The attribute will be the same regardless of the element.
<obj1 id="1" name="sally" />
<obj2 id="15" date="yesterday" />
I've been trying various forms of this, but it's not working:
SELECT
[OriginalRecordXml].value('(/./id)[1]', 'varchar(MAX)')
FROM [AuditRecords]
Is this possible?