Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

On Error Resume Next not working in transformation

Status
Not open for further replies.

deanbri75

Technical User
Jan 6, 2004
26
US
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:

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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top