dbTalk Databases Forums  

Flat File Source - Skipping Corrupted rows

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


Discuss Flat File Source - Skipping Corrupted rows in the microsoft.public.sqlserver.dts forum.



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

Default Flat File Source - Skipping Corrupted rows - 04-13-2006 , 09:57 AM






I do a nightly import from a comma delimited text file that is downloaded
nightly.

Quite often, the data will contain a corrupt, ususally in the form of an
incorrect delimiter. Well, this causes the whole package to fail. I have
tried redirecting rows, but no result. I was hoping there would be a way for
me to simply skip the corrupt row and continue on.

Any help would be GREAT!

Thank you,
--
Eric

Reply With Quote
  #2  
Old   
Jeff Ericson
 
Posts: n/a

Default RE: Flat File Source - Skipping Corrupted rows - 04-13-2006 , 03:09 PM






You can skip rows. here is my activeX transform to skip specific rows.
You'll need to figure out how to identify the row programatically though.

'************************************************* *********************
' Visual Basic Transformation Script
'************************************************* ***********************

' Copy each source column to the destination column
Function Main()
if datediff( "s", DTSGLobalVariables("gvMaxDataDate").value,
DTSSource("Col001")) > 0 then
'if DTSSource("Col001") > DTSGLobalVariables("gvMaxDataDate").value then
'msgbox "Load"
'msgbox DTSSource("Col001")
'msgbox DTSGlobalVariables("gvMaxDataDate").value
DTSDestination("LOG_TIMESTAMP") = DTSSource("Col001")
DTSDestination("EVENT_TYPE") = DTSSource("Col002")
DTSDestination("EVENT_RESULT") = DTSSource("Col003")
DTSDestination("START_TIME") = DTSSource("Col004")
DTSDestination("FINISH_TIME") = DTSSource("Col005")
DTSDestination("DOCUMENT_FILE_NAME") = DTSSource("Col006")
DTSDestination("DOCUMENT_FILE_VERSION") = DTSSource("Col007")
DTSDestination("DOCUMENT_FILE_SIZE") = DTSSource("Col008")
DTSDestination("USER_NAME") = DTSSource("Col009")
DTSDestination("ACTUATE_SUBSYSTEM") = DTSSource("Col010")
DTSDestination("Col011") = DTSSource("Col011")
DTSDestination("Col012") = DTSSource("Col012")
DTSDestination("Col013") = DTSSource("Col013")
DTSDestination("Col014") = DTSSource("Col014")
DTSDestination("Col015") = DTSSource("Col015")
DTSDestination("Col016") = DTSSource("Col016")
DTSDestination("Col017") = DTSSource("Col017")
DTSDestination("Col018") = DTSSource("Col018")
DTSDestination("Col019") = DTSSource("Col019")
DTSDestination("Col020") = DTSSource("Col020")
DTSDestination("Col021") = DTSSource("Col021")
DTSDestination("Col022") = DTSSource("Col022")
DTSDestination("Col023") = DTSSource("Col023")
DTSDestination("Col024") = DTSSource("Col024")
DTSDestination("Col025") = DTSSource("Col025")
DTSDestination("Col026") = DTSSource("Col026")
DTSDestination("Col027") = DTSSource("Col027")
DTSDestination("Col028") = DTSSource("Col028")
DTSDestination("Col029") = DTSSource("Col029")
DTSDestination("Col030") = DTSSource("Col030")
DTSDestination("Col031") = DTSSource("Col031")
DTSDestination("Col032") = DTSSource("Col032")
DTSDestination("Col033") = DTSSource("Col033")
DTSDestination("Col034") = DTSSource("Col034")
DTSDestination("Col035") = DTSSource("Col035")
DTSDestination("Col036") = DTSSource("Col036")
DTSDestination("Col037") = DTSSource("Col037")
DTSDestination("Col038") = DTSSource("Col038")
DTSDestination("Col039") = DTSSource("Col039")
DTSDestination("Col040") = DTSSource("Col040")
Main = DTSTransformStat_OK
else
'date1 = DTSSource("Col001")
'date2 = DTSGlobalVariables("gvMaxDataDate").value

'msgbox (DateDiff( "s" , date1 , date2))

'msgbox "Skipped"
'msgbox DTSSource("Col001")
'msgbox DTSGlobalVariables("gvMaxDataDate").value
main = DTSTransformStat_SkipRow
end if
End Function



"Eric" wrote:

Quote:
I do a nightly import from a comma delimited text file that is downloaded
nightly.

Quite often, the data will contain a corrupt, ususally in the form of an
incorrect delimiter. Well, this causes the whole package to fail. I have
tried redirecting rows, but no result. I was hoping there would be a way for
me to simply skip the corrupt row and continue on.

Any help would be GREAT!

Thank you,
--
Eric

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.