Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

SSIS : IsDBNull Function is not working as expected

Posted on 2010-09-03
18
Medium Priority
?
1,003 Views
Last Modified: 2013-11-10
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?
0
Comment
Question by:asubbiah
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
  • +4
18 Comments
 
LVL 12

Accepted Solution

by:
GMGenius earned 168 total points
ID: 33595056
There is a really good article that I think might help you here
http://www.mssqltips.com/tip.asp?tip=2028
I think you need ISNULL(DateOfBirth)
 
0
 
LVL 22

Expert Comment

by:neeraj523
ID: 33595063
try

if DateOfBirth = "" Then
0
 
LVL 16

Expert Comment

by:vdr1620
ID: 33596562
Trying using ISNULL OR LEN (DateOfBirth) > 1 --- should definetly work
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 30

Assisted Solution

by:Reza Rad
Reza Rad earned 168 total points
ID: 33602449
you should:
Check the retain null values from the source as null values in the data flow option and then you will get your nulls

this will solve empty values from flat file in ssis problem

reference:
http://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/b2984e44-c353-4a6d-9761-8a589bcc5063




0
 
LVL 12

Assisted Solution

by:Mohamed Abowarda
Mohamed Abowarda earned 164 total points
ID: 33604029
Try the following:
If DateOfBirth Is Nothing Or DateOfBirth = "" Or Len(DateOfBirth) < 1  Then

End If

Open in new window

0
 
LVL 12

Expert Comment

by:Mohamed Abowarda
ID: 33604034
Also try:
If DateOfBirth Is DBNull.Value Then

End If

Open in new window

0
 
LVL 21

Expert Comment

by:Alpesh Patel
ID: 35239735
Please check null or convert null to blank in first query.
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 35245711
PatelAlpesh,

I ma not sure if you noticed, but this question is more than 6 months old and the author appears to be MIA.
0
 
LVL 12

Expert Comment

by:Mohamed Abowarda
ID: 35434868
I have posted possible solution for this question
0
 
LVL 12

Expert Comment

by:GMGenius
ID: 35435048
I too also gave a good link to assist here. I recomend a split between all contributors
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 35451205
I recommend you award points to:
http:#a33595056
http:#a33602449
0
 
LVL 12

Expert Comment

by:Mohamed Abowarda
ID: 35451311
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
0
 
LVL 12

Expert Comment

by:GMGenius
ID: 35452824
I agree - all contributors where helpfull
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question