When inserting data into a table what is the best way to verify that there is not a PK violation?

  • What I am doing is reading in multiple XML files and inserting the data into tables. Sometimes there is a duplicate file and thus a PK constraint is violated. What I would like to do is move that file to another folder and go on to the next file. I thought what I could do is an OLE DB Command prior to the database insert and use a Conditional Split to determine if the row should be inserted or the file moved.

    In the OLE DB command how do I get the value returned into a variable to use in the Conditional Split? I am using the following SQL command "Select count(*) From Specifications Where RSID=? AND RSITER=?" Can I get access to the value returned?

    Any suggestions on the best way to do this?

    Thanks

  • Before your conditional split I would use a lookup to see if it is there, if so, set a value to one, if not then nothing will happen, for the ones with the value as one, send them off on to an alternate path, for the ones without, let them continue on..

    CEWII

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

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