SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


SSIS + Flat File Source + ignore invalid rows + CSV


SSIS + Flat File Source + ignore invalid rows + CSV

Author
Message
sudhirbharti-565093
sudhirbharti-565093
Grasshopper
Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)

Group: General Forum Members
Points: 23 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?
ab5sr
ab5sr
SSC-Addicted
SSC-Addicted (412 reputation)SSC-Addicted (412 reputation)SSC-Addicted (412 reputation)SSC-Addicted (412 reputation)SSC-Addicted (412 reputation)SSC-Addicted (412 reputation)SSC-Addicted (412 reputation)SSC-Addicted (412 reputation)

Group: General Forum Members
Points: 412 Visits: 701
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 BigGrin 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


Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search