dbTalk Databases Forums  

Skipping Rows With Bad Data

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Skipping Rows With Bad Data in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
BradR
 
Posts: n/a

Default Skipping Rows With Bad Data - 08-08-2006 , 08:32 PM






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.


Reply With Quote
  #2  
Old   
Davide
 
Posts: n/a

Default Re: Skipping Rows With Bad Data - 08-09-2006 , 04:12 AM






Hello BradR,

Quote:
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.

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?




Reply With Quote
  #3  
Old   
BradR
 
Posts: n/a

Default Re: Skipping Rows With Bad Data - 08-09-2006 , 10:22 AM



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.

Davide wrote:
Quote:
Hello BradR,

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.


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?


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.