Link to home
Start Free TrialLog in
Avatar of Oneill0003
Oneill0003

asked on

SSIS Derived Column

Experts:
I have a DTS package that I’m trying to rewrite in SSIS, In my DTS package on one of my transformation were I’m mapping source to destination I have a field that gets populated by a global variable, I use a simple active x script to determine witch variable to use, the script looks like this

Function Main()

If DTSGlobalVariables("i_Max_Skl_Stat_Datetime").Value < DTSGlobalVariables("i_Max_Agt_Stat_Datetime").Value Then

DTSDestination("Data_Datetime") = DTSGlobalVariables("i_Max_Skl_Stat_Datetime").Value

Else

DTSDestination("Data_Datetime") = DTSGlobalVariables("i_Max_Agt_Stat_Datetime").Value

End if
Main = DTSTransformStat_OK
End Function

In SSIS I’m trying to use a Derived Column transformation to accomplish since it has an expression editor but can't see how to use the IF / ELSE logic doesn’t seem to like it, is this not the right transformation to use for this?

Thanks in advance.
Avatar of navalarya1982
navalarya1982

I think sql server 2005 SSIS has a built in support for migrating/upgrating the older version DTS packages to new one.


just explore it and u will be able to find something on it.

Let me know if u dont find anything..

Thanks,
Naval
Conditional's within a derived column are formatted as:
Boolean Expression ? True part : False part
e.g. IsNull(MyField) ? "" : MyField

Avatar of Oneill0003

ASKER

drydenhogg: i'm having trouble getting my expression build can you give me a hand with this?

i_Max_Skl_Stat_Datetime < i_Max_Agt_Stat_Datetime ? i_Max_Skl_Stat_Datetime : i_Max_Agt_Stat_Datetime

Thanks guys!
ASKER CERTIFIED SOLUTION
Avatar of drydenhogg
drydenhogg

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks drydenhogg, that worked great, i was just missing a few things on my syntax but got it working.!