I have a DTS job that runs daily. It imports a text file into a table. The problem is that the source that produces the text file has no validation to make sure that the data is the type it's supposed to be. Consequently, the text file can contain data that's not of the appropriate type such as 0818205 as a date instead of 08182005. To compensate for this I tried the following transformation script when importing that column:
When I run the package, it still gives me the error "The number of failing rows excedes the maximum number specefied."
I thought On Error Resume Next meant that if a row failed, just skip it and move on to the next one? That's really what I want to do. Is there another way to handle this and keep the package from failing?
thanks,
brian
Code:
'**********************************************************************
' Visual Basic Transformation Script
'************************************************************************
Function Main()
On Error Resume Next
dim i_Day
dim i_Month
dim i_Year
i_Day = Cint(Mid( DTSSource("Col005") ,7 , 2 ))
i_Month = Cint(Mid( DTSSource("Col005") ,5 , 2 ))
i_Year = Cint(Left(DTSSource("Col005"),4))
DTSDestination("ISSDT") = DateSerial( i_Year , i_Month ,i_Day )
Main = DTSTransformStat_OK
End Function
When I run the package, it still gives me the error "The number of failing rows excedes the maximum number specefied."
I thought On Error Resume Next meant that if a row failed, just skip it and move on to the next one? That's really what I want to do. Is there another way to handle this and keep the package from failing?
thanks,
brian