Precedence constraint not working in SSIS

  • Hi All,

    I have a task which reads multiple XML files and loads filename and XML data in database. Each time I load the file, I have to check for ID from the file. If the ID already exists in XML data , then do not load that file (skip that and check for next one).

    I have a SQL task which has the query

    select CAST(COUNT(*) AS bit) as isExisting from xml_data where XML_data.exist('//ID/text()[. = "?"]') = 1.

    I am passing the ID into "?" from a variable and collecting the result in resultset as single row.

    I am declaring Resultname=0(I tried with isExisting) and saving it in variablename=Idexist.

    When I check for @Idexist=0(i tried with @Idexist=true/false) in precedence constraint, this is not allowing me to load the ID which exists(which is correct), but does not load the ID which is not present as well.

    Can you please let me know where am I going wrong?

    When I check this query in a database, it returns the correct value.

Viewing 0 posts

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