dbTalk Databases Forums  

SSIS derived columns?

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss SSIS derived columns? in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
brian_harris
 
Posts: n/a

Default SSIS derived columns? - 06-16-2006 , 02:23 PM






In my application I am copying 2 million records from an oracle table to
sqlserver table. While this is occuring 3 fields need to be derived and I am
doing all of them in single derived column transformation. two of these use
the same if conditional to determine how column is derived. It looks like
the only way to do a conditional is using ?: operator. So in transformation
I have created two derived columns and for each of them I have repeated my if
conditional so that I can fill fields. This does not seem to be a good way
to do it for performace purposes.

Is their a better way of doing this such as in one of those expression areas
make a expression that will calculate an assign both of these values at one
time without doing condtion twice. The calculations are different for each
column, but if statment is same.
Below are the two expressions I used, 1 for each dervied column
(ISNULL(IMPAIRDT) || IMPAIRDT == 0) ? 0 : 1
(ISNULL(IMPAIRDT) || IMPAIRDT == 0) ? 0 : (ADMTDATE - IMPAIRDT)

Is their a way to do if else statments with multiple lines inbetween them in
expressions?

Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: SSIS derived columns? - 06-17-2006 , 06:07 AM






Hello brian_harris,


From what I understand of the requirements no. What I would like to see
in future is the Derived columns be evaluated top -> bottom. I would then
like to be able to use a previously defined column in a later expression.
Whilst I dare say the evaluation of the values would be done the same way
as if I had type it out the long way it would save me having to type so much


Remember that if you can derive these column values on the source then do
it there. The same thing applies to sorting. Just because SSIS has a SORT
transform I would not be using it if I can do it on the source.


Allan



Quote:
In my application I am copying 2 million records from an oracle table
to sqlserver table. While this is occuring 3 fields need to be
derived and I am doing all of them in single derived column
transformation. two of these use the same if conditional to determine
how column is derived. It looks like the only way to do a conditional
is using ?: operator. So in transformation I have created two derived
columns and for each of them I have repeated my if conditional so that
I can fill fields. This does not seem to be a good way to do it for
performace purposes.

Is their a better way of doing this such as in one of those expression
areas
make a expression that will calculate an assign both of these values
at one
time without doing condtion twice. The calculations are different for
each
column, but if statment is same.
Below are the two expressions I used, 1 for each dervied column
(ISNULL(IMPAIRDT) || IMPAIRDT == 0) ? 0 : 1
(ISNULL(IMPAIRDT) || IMPAIRDT == 0) ? 0 : (ADMTDATE - IMPAIRDT)
Is their a way to do if else statments with multiple lines inbetween
them in expressions?




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.