سؤال

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>
هل كانت مفيدة؟

المحلول

select @data.exist('row/*[text()]')

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

sql fiddle demo

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top