XML "field" exists not '"data" ???

  • Hi ,

    I have a query where it picks up multiple lines for an table with XML data based on the form

    The table does have a form number so I could use that to get the correct occurance of the table, but was thinking what if a new form is developed giving a new number. So, the question is can I use a where clause on if the field exists?

    Field is called "Type" so something like (I know the expression is wrong)    where  data.field( '/Data/Type)[1]') = 1 ?

     

    Thanks

     

     

     

  • So I figured out a work around using

    and Data.value('(/Data/Type)[1]', 'nvarchar(100)') is not null

     

    but if anyone else knows another option, always good to know...

     

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply