declare @data xml
set @data = '<Data ID="34" ORGANIZATION="2301" STATUS="Active" PER_ID="5833" PERSON_NAME="John Smith" />'
select
T.C.value('ID[1]', 'nvarchar(128)') AS ID,
T.C.value('ORGANIZATION[1]', 'nvarchar(128)') AS ORGANIZATION,
T.C.value('STATUS[1]', 'nvarchar(128)') AS [STATUS],
T.C.value('PER_ID[1]', 'nvarchar(128)') AS PER_ID,
T.C.value('PERSON_NAME[1]', 'nvarchar(128)') AS PERSON_NAME
from @Data.nodes('Data') as T(C)
Hi all
I have this data, but when I query the xml, I am getting all NULL data. can you please tell me what I did wrong
Thanks
sqldev