I'm trying to query an XML column in SQL server, and I want to select records where an attribute value matches a case-insensitive string.
For instance, consider the following value for the XML column:
<items>
<item k="Description" v="hello" />
</items>
Right now, my select looks like this:
SELECT
MyXmlColumn.value('(/items/item[@k="Description"]/@v)[1]', 'nvarchar(max)') as v
FROM Table
The problem is that the value of the "k" attribute could be 'Description', 'description', or 'DESCRIPTION'.
How do I write the XQuery so that it performs a case-insensitive match?