Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

SSIS + Flat File Source + ignore invalid rows + CSV Expand / Collapse
Author
Message
Posted Tuesday, March 3, 2009 5:37 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Thursday, January 26, 2012 10:39 AM
Points: 19, Visits: 129
I am creating a package through SSIS. when I try to import the csv file in sql table by using the DataFlow-->Flat File Source-->OLE DB Destination, it is working fine for this format.
2,raj,delhi,4,4
1,sudhir,d,3,4
but when the csv format like this
2,raj,delhi,4,4
3,2
2,raj,delhi,4,4

it throws an error message, due to second row is incomplete.

So the question is how we can eliminate the row which not contains the complete column.

Any Ideas?
Post #667199
Posted Tuesday, March 3, 2009 5:55 AM


SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Thursday, May 29, 2014 9:29 AM
Points: 214, Visits: 647
This is a good question...someone probably has an answer but I don't. If I may, I'd respond with a comment. First, I've never seen one like this, stoked that I don't have a file that's in that bad of shape :D Second, without all of the delimiters, how do you tell which column goes where?

Example:

Your data
2,raj,delhi,4,4
3,2
2,raj,delhi,4,4

So for this row (PK violation notwithstanding)
2,raj,delhi,4,4

suppose you get this?

2,4

How can you tell whether the first "4" is for the fourth attribute or the fifth?





Lee Everest

Post #667209
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse