How to check destination data before loading new data

  • Whats the best way to achive this kind of functionality with SSIS?

    I have a version value stored as a variable or in a table or whatever. Before I start to load the data from source DB to the destination DB I need to check with SSIS if any of the destination DB tables have rows with a column named version as this value.

    If the destination tables have rows with this value I want the package to fail and create a custom message or something. If destination tables have no rows with this version value I want the package to continue.

    Any suggestions or links to external resources how to achive this kind of data checking functionality is welcome.

    Tupe

  • Introduce an initial Execute SQL task which sets a package variable to, say, the result of running a query like this:

    select count(*) [VersionCount] from table

    where version = 'xxxxxx'

    Then, after your Execute SQL task, you can add a precedence constraint to direct the job down the relevant path (0 = process, > 0 = fail, I guess).

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

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

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