Page 1 of 1

Nullable Key Column

Posted: Wed Feb 01, 2012 3:01 am
by harshada
Can a key column be nullable (nullable =yes). In one of the jobs I can see this. More than one columns are key columns and out of those all are nullable =No, except one column, still the job is running fine.

Want to understand how this is working.
Also, can we apply a if 'isnull' function on the key column where
nullable =yes as well as key column where nullable = no

Posted: Wed Feb 01, 2012 6:54 am
by jwiles
Yes, key columns can be nullable. NULLs are effectively another value for a column and you're still bound to any unique constraints that are in effect for your data source/target.

Null-handling logic in the modify and transformer stages is meant to be applied only to nullable columns. You will receive warnings if you try to use IsNull() on a non-nullable column.

Regards,

Posted: Wed Feb 01, 2012 7:33 am
by harshada
Thanks.

I expected the same. But now the job is aborting with error

Using "null" conversion with non-nullable input
APT_CombinedOperatorController(0),0: Null handling function called on a not nullable field.

for the only column which is key and nullable is Yes and not for the rest of the key columns which are already nullable=no. This is strange.

Posted: Wed Feb 01, 2012 3:05 pm
by ray.wurlod
Just get it right. If the data can contain nulls, mark them as nullable and handle the nulls. If the data can not contain nulls, do neither of these things.