Sql query to Check if any of columns in a XML row has value

171 views Asked by At

I have below XML. I need to check if any of column in this row has a value or not.

<row>
    <Row></Row>
    <TaskName></TaskName>
    <TaskType>someFooValue</TaskType>
    <PlanDate></PlanDate>
    <ForecastDate></ForecastDate>
    <Status></Status>
    <AssignedTo></AssignedTo>
    <Predecessors></Predecessors>
    <SortOrder></SortOrder>
    <Duration></Duration>
    <PerComplete></PerComplete>
    <PlannedEndDate></PlannedEndDate>
    <ForecastEndDate></ForecastEndDate>
</row>
1

There are 1 answers

0
Roman Pekar On BEST ANSWER
select @data.exist('row/*[text()]')

Will return 1 if there're some non-empty value.

sql fiddle demo