asubbiah
asked on
SSIS : IsDBNull Function is not working as expected
Hi,
Im using SSIS to create a flat file retrieving data from a table. Im using Visual Basic 2008 and SQL server 2008.
I have a Data flow Task inside which i have a OLE DB Source component which retrieves data from a table and sends it to a script component. One of the field that is retrieved from the table is a DateOfBirth Field. It is of datatype "date". When i use IsDBNull(DateOfBirth) in the Script component im getting a "RunTime Error: The column has a null value.".
Why is this happening? Is this a bug in SSIS?
Im using SSIS to create a flat file retrieving data from a table. Im using Visual Basic 2008 and SQL server 2008.
I have a Data flow Task inside which i have a OLE DB Source component which retrieves data from a table and sends it to a script component. One of the field that is retrieved from the table is a DateOfBirth Field. It is of datatype "date". When i use IsDBNull(DateOfBirth) in the Script component im getting a "RunTime Error: The column has a null value.".
Why is this happening? Is this a bug in SSIS?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Trying using ISNULL OR LEN (DateOfBirth) > 1 --- should definetly work
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Also try:
If DateOfBirth Is DBNull.Value Then
End If
Please check null or convert null to blank in first query.
PatelAlpesh,
I ma not sure if you noticed, but this question is more than 6 months old and the author appears to be MIA.
I ma not sure if you noticed, but this question is more than 6 months old and the author appears to be MIA.
I have posted possible solution for this question
I too also gave a good link to assist here. I recomend a split between all contributors
It wouldn't be fair to split point between two experts practiced in the question and posted possible solution while the others not who actually posted possible solutions too.
I recommend closing this question by accepting each possible solution:
http:#33595056
http:#33602449
http:#33604029
I recommend closing this question by accepting each possible solution:
http:#33595056
http:#33602449
http:#33604029
I agree - all contributors where helpfull
if DateOfBirth = "" Then