Search code examples
ssisssis-2008

How to read first line of the flat-file containing date value and compare with a user variable defined in 2008 SSIS package without using sript task


i want to read first line of the flat-file containing date value and compare with a user variable defined in 2008 SSIS package without using sript task.


Solution

  • This solution is a bit long for what the simple task you require but since you don't you want to use script task, you can try below:

    1. Create variable to store the date value from your flat file
    2. Create a data flow task to import the flat file into a SQL table.
    3. Add an Execute SQL task to get the first line from the SQL table and map the result set to the variable created at step 1.
    4. You can now compare the variable created and the one you already have. e.g @[User::NewVariableCreated] == @[User::ExistingVariable]

    This will return a Boolean data type result of True or False depending on the values supplied.

    Hope this helps.