sql server - Find all "null" values using xquery -
i tasked find values <nodea> empty. mean null, or doesn't exist.
i have crafted below query
select * table attributelist.value ('(/attributelist/nodea)[1]', 'varchar(50)') null however returns results <attributelist />
what curious of return xml looked like
<attributelist> <nodea></nodea> </attributelist>
there no need extract values xml. use exist instead.
select * yourtable attributelist.exist('/attributelist/nodea/node()') = 0
Comments
Post a Comment