Link to home
Start Free TrialLog in
Avatar of elucero
elucero

asked on

ssis expression with isnull?

I'm trying to do  this

if the source column is null then make it null if not make it the same column

Have to do it with a varchar and a Boolean data types
this is what I have but not working thanks

((ISNULL(RS_NAME)? NULL(DT_WSTR,2):RS_NAME)!=(ISNULL(Dest_RS_NAME)? NULL(DT_WSTR,2):Dest_RS_NAME))
 
   (ISNULL((DT_BOOL)Provider) ? (DT_BOOL)NULL : (DT_BOOL)Provider) !=   (ISNULL((DT_BOOL)Dest_Provider) ? (DT_BOOL)NULL : (DT_BOOL)Dest_Provider)
Avatar of Russ Suter
Russ Suter

I think the COALESCE() function would work for you here.

SET Dest_RS_NAME = COALESCE(RS_NAME, NULL)

Basically, all this does is set Dest_RS_NAME to the first non-null value in the list of COALESCE arguments. The trick here is that the last argument in COALESCE is, itself, NULL. If COALESCE runs off the end of the arg list without finding a non-null value it returns a null. So...

If RS_NAME is NULL then COALESCE will return the 2nd argument which is also NULL. If RS_NAME is not NULL then COALESCE will return whatever the value if RS_NAME is. The data type will match.
Avatar of elucero

ASKER

How do I put this in a conditional split?
ASKER CERTIFIED SOLUTION
Avatar of Arifhusen Ansari
Arifhusen Ansari
Flag of India image

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