Sqlserver
 sql >> Database >  >> RDS >> Sqlserver

Attributo xml della query di SQL Server per un valore di elemento

;WITH XMLNAMESPACES(DEFAULT N'http://www.kaseya.com/vsa/2007/12/ServiceDeskDefinition.xsd')
select
    T.C.value('data(.)', 'nvarchar(128)')
from [YOUR_TABLE] as Y
    outer apply Y.[YOUR_XML_COLUMN].nodes('/CustomFields/Field[@fieldName="CwTicketId"]') as T(C)