Skipping Rows With Bad Data

Skipping Rows With Bad Data

Post by Brad » Thu, 10 Aug 2006 10:32:29


As I process a text file, I need skip rows that that have missing data.
I added the following row transformation script, but it causes every
row to be skipped.


Function Main()
Dim missingFields
Main = DTSTransformStat_OK
missingFields = ""

if IsNull(DTSSource("Address1")) or trim(DTSSource("Address1").value)
= "" then
missingFields = missingFields + "Address1"
Main = DTSTransformStat_SkipInsert
end if

End Function


I've also tried setting Main = DTSTransformStat_SkipRow.

It looks like what's happening is that if one row get's skipped, all
the rows get rolled back.
But I've turned off transactions and still don't get any data.

Any ideas would be greatly appreciated.
 
 
 

Skipping Rows With Bad Data

Post by David » Thu, 10 Aug 2006 18:12:25

Hello BradR,


Is this the only transformation you have in your datapump and the script
you use is precisely like the one you wrote in your post

 
 
 

Skipping Rows With Bad Data

Post by Brad » Fri, 11 Aug 2006 00:22:51

This code is actually OK. It turned out I messed something up in the
next step.

I did end up putting all row transformations in 1 script.