Hi All,
I am trying to retrieve xml values dynamically as I don't know how many RuleIDs I will get. Here is my code. It's returning null
declare @world table(ID uniqueidentifier primary key default(newid()),Person xml)
insert into @world(Person) values('
')
select x.y.value('(RuleID1)[1]','int') from @world
cross apply Person.nodes('(/Person/*)') x(y)
Please help. I can get as many RuleID1 tags, its dynamic. I want all of its values
Thanks
Deepali

Jignesh KumarRank #91 · 22.9K reputationPosted Feb 3, 2020, 6:28 PM EST