How to update the SQL table data in the SSIS data flow task?

Hi All,

Can anyone please help me with the following scenario?

1) I have a SQL table in staging DB (say T1) which contains the columns Name, ID (PK), Desc, IsValid.

2) I want to validate the data in the T1 with business rules and update the flag IsValid in the same table.

3) For validation, created a dataflow task in which the source DB is configured to T1 and added a Script component where I am performing my validations and storing the final flag value.

4) Now, how to update my final flag in T1 ?

Any help/suggestions would be of a great help.

Thanks,

Sri

February 24th, 2015 3:41am

Based on flag value, flow will split in 2.

You can update the column IsValid by using Derived Column transformation task. Flow should like below:

Free Windows Admin Tool Kit Click here and download it now
February 24th, 2015 4:41am

Hi Vibhav,

The flow you have provided seems to be complicated for my scenario. Let me put it more clear.

1) I have table T1 in the staging which contains IsValid flag which will be Null initially.

2) I need to read the data from table T1, validate with business rules and update only the flag value for each row in the same table T1 (i.e. it should overwrite NULL value to True/False).

To achieve it, I wanted to use the source and destination as the same table T1 where IsValid flag need to be updated in the destination. Flag value after the validation is stored in a variable in the script component which is added in between source and destination.

what component will work for my scenario in between the script component and the destination table to update the flag in the table?

If my assumptions are wrong, please correct me or else please help me with where I am struck.

Thanks,

Sri

February 24th, 2015 5:19am

Hi Vibhav,

Sorry, missed out one point in my requirement. Rewriting the steps:

1) I have table T1 in the staging which contains IsValid flag which will be Null initially.

2) I need to read the data from table T1, validate with business rules and update only the flag value for each row in the same table T1 (i.e. it should overwrite NULL value to True/False)

3) And also I am storing error messages (if data invalid) in a script component variable which should be moved to log Log table.

Thanks,

Sri

Free Windows Admin Tool Kit Click here and download it now
February 24th, 2015 5:37am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics