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


Flat file connection having column names in Header


Flat file connection having column names in Header

Author
Message
Anamika
Anamika
SSChasing Mays
SSChasing Mays (602 reputation)SSChasing Mays (602 reputation)SSChasing Mays (602 reputation)SSChasing Mays (602 reputation)SSChasing Mays (602 reputation)SSChasing Mays (602 reputation)SSChasing Mays (602 reputation)SSChasing Mays (602 reputation)

Group: General Forum Members
Points: 602 Visits: 1026
Hi,

I'm using a Flat file destination. I 'Check' the column names in the first data row in the connection and 'un check' overwrite the data in file.

So that i should have column names in first row and every time the data should be updated to the existing flatfile and not over written.

But the problem is every time it writes the column headers when it writes the data to the file. I get the headers in between data rows.
ID NAME
1, ZED
ID NAME
2, MAX



I tried from package configurations to write the property 'column names in the first row' to be true. but it is not taking the original column names instead it takes like column1, column 2 etc.

how to resolve this?

Thanks,
Ami
kl25
kl25
Say Hey Kid
Say Hey Kid (690 reputation)Say Hey Kid (690 reputation)Say Hey Kid (690 reputation)Say Hey Kid (690 reputation)Say Hey Kid (690 reputation)Say Hey Kid (690 reputation)Say Hey Kid (690 reputation)Say Hey Kid (690 reputation)

Group: General Forum Members
Points: 690 Visits: 1875
Is it writing the column names between every row or between every run of the process? If the data is not to be overwritten and you have specified putting the column names in the first data row, then everytime you run the process, the column names will be the first row appended to the file.
herladygeekedness
herladygeekedness
Mr or Mrs. 500
Mr or Mrs. 500 (512 reputation)Mr or Mrs. 500 (512 reputation)Mr or Mrs. 500 (512 reputation)Mr or Mrs. 500 (512 reputation)Mr or Mrs. 500 (512 reputation)Mr or Mrs. 500 (512 reputation)Mr or Mrs. 500 (512 reputation)Mr or Mrs. 500 (512 reputation)

Group: General Forum Members
Points: 512 Visits: 813
Yeah, uncheck the Column Headers and see how it goes.
blasto_max
blasto_max
Old Hand
Old Hand (375 reputation)Old Hand (375 reputation)Old Hand (375 reputation)Old Hand (375 reputation)Old Hand (375 reputation)Old Hand (375 reputation)Old Hand (375 reputation)Old Hand (375 reputation)

Group: General Forum Members
Points: 375 Visits: 480
Yes, the unchecking of columns in first row will not help if you are putting data into a file for the first time. Search google for "ssis merge flat files". I found one solution here - http://social.msdn.microsoft.com/Forums/sqlserver/en-us/771a7e11-cf32-48af-bd64-dfc058819e19/how-to-merge-csv-files-using-ssis?forum=sqlintegrationservices

try it and see how it goes.

A foreach loop to iterate over each of your CSV files.

Inside the foreach loop, I would add a data flow. Then in the data flow create a single Flat File Source and a single Flat File destination. The destination should be setup to append, not overwrite. Then, you can configure the Flat File Source via expressions to take its current values from the Foreach Loop so that each time a new file is encounted, the data flow executes, appending data to a single file.

There are plenty of examples of how to do this on this forum and on the 'Net. So, for the time being, I'll leave that exercise for you to perform. Search for "foreach loop expressions data flow" and see what you come up with.
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