Sammenligningen skelner mellem store og små bogstaver, så du skal sammenligne med både c# og C#. I SQL Server 2008 kan du bruge store bogstaver .
declare @T table
(
ID int identity,
Skills XML
)
insert into @T values
('<Skills><Skill>C#</Skill><Skill>ASP.NET</Skill><Skill>VB.NET</Skill></Skills>')
insert into @T values
('<Skills><Skill>CB.NET</Skill><Skill>ASP.NET</Skill><Skill>c#</Skill></Skills>')
insert into @T values
('<Skills><Skill>F#</Skill><Skill>ASP.NET</Skill><Skill>VB.NET</Skill></Skills>')
select ID
from @T
where Skills.exist('/Skills/Skill[contains(., "C#") or contains(., "c#")]') = 1
Resultat:
ID
-----------
1
2
Opdatering:
Dette vil også virke.
select T.ID
from @T as T
cross apply T.Skills.nodes('/Skills/Skill') as X(N)
where X.N.value('.', 'nvarchar(50)') like '%C#%'