views:

33

answers:

2

I'm having a strange problem with SSIS. I'm exporting some data from a database into a flat file. It comes out all fine - except that rather than displaying the data like this:

ID FirstName LastName Age

It comes out like this:

ID FirstName LastName Age ID1 FirstName1 LastName1 Age1

Now, its not repeating the same data (ever), so the data might realistically look like this:

1 John Doe 23 2 Jane Doe 22

Why is it repeating like this?

+1  A: 

It sounds to me like the row delimiter from your file source is wrong. It's reading in two or more rows as one row.

What are the output columns listed on the flat file source? If you see all of those you listed, I would almost guarantee this is the issue.

What is the actual layout of the source file? Is it delimited, fixed width columns, etc?

Kenneth
It is fixed width columns. Not sure how to see output columns?
davemackey
Right click on the data flow path (green arrow) coming out of the flat file source. The Metadata tab will list your columns.
Kenneth
ID, LastName, FirstName, M_Initial, Sch_Date, AY_Token, Sch_Amount, POE_Token, Create_Dt, Status
davemackey
Are those the actual columns you expect/defined? 10 columns in the source file? What happens after that? Are you applying any transformations?
Kenneth
I don't think there are any transformations. its just dropping them straight from the db into a flat text file. I recreated the project by dropping an ado net data source and a flat file destination.
davemackey
Not sure if this helps, but I went into SMSS and did a straight export on the database table through the SMSS interface - and the same problem occurred!
davemackey
+1  A: 

In a fixed-width destination (even though it's "text") - it's really fixed width records (just in a text representation in the code page of your choice), one after another with nothing in between them. So you need to add a record/row delimiter - in this case CRLF.

If you are in a Flat file destination component and click the new button to crete a destination data adapter right there - the "wizard" gives you four options. The difference between fixed-width and fixed-width with row delimiters is that it just puts a little CRLF column on the end.

Cade Roux