I\'m trying to select from XML that has a null as one of the attributes. Instead of returning a null, it returns a 0. What am I doing wrong?
See code below to replicate:>
I think if you use the number() function, you'll get null as expected. This only works for number types though:
select
ParamValues.TaskChainerTask.query('Property1').value('number(.)','int') as Property1,
ParamValues.TaskChainerTask.query('Property2').value('number(.)','int') as Property2
from @a.nodes('(/TestSet/Element)') as ParamValues(TaskChainerTask)