tags:

views:

309

answers:

2

I have an OLE DB Command component in an SSIS Package that runs an update statement against a SQL table. Now, my statement initially is like:

update myTable set columnA=?, columnB=? where columnC=?

Where the three "?"'s are inputs to my component from another Conditional Split component. I can link each column name with each input parameter (the ?), so column A = param0, column B = param1.

Now, my query is more complex, I need to do;

update myTable set columnA=(param1+param2), columnB=(param2) where columnC=param1*param2

How can I do this in SSIS?

+1  A: 

Yes. Simply compute those values in a Derived Column transform, and use them instead of the parameters you're using now.

John Saunders
+1  A: 

Why not just have a derived column before the update command, and calculate these fields?

Create new columns with names/value as such:
columnA=param1+param2:
columnB=param2:
columnC=param1*param2:

Then redirect the output to the update command and use them as the parameters. This way, you do not have to do any calculations in your query, which makes for a much cleaner IS package.

Jefe
Yes, that's what I ended up doing.
Saobi