In a table schema like below
CREATE TABLE [dbo].[Employee](
[EmployeeId] [uniqueidentifier] NOT NULL,
[Name] [nvarchar](50) NOT NULL,
[Location] [nvarchar](50) NOT NULL,
[Skills] [xml] NOT NULL
CONSTRAINT [PK_Employee] PRIMARY KEY CLUSTERED
How would i get Employees having
C#
(case insensitive) programming skills assuming the xml saved in theSkills
columns is as below.Could you advice on other functions would help me filter, sort when using xml data type columns
<Skills><Skill>C#</Skill><Skill>ASP.NET</Skill><Skill>VB.NET</Skill></Skills>
The comparison is case sensitive so you need to compare against both c# and C#. In SQL Server 2008 you can use upper-case.
Result:
Update:
This will also work.