FlatFile in SSIS

  • Hi, I m trying to create a flat file with a header in it. Everything looks good, but column names and the header are coming in the same row. I want header row on top and then column names and data. How can I do this?

    Thank you

  • ssismaddy (9/22/2011)


    Hi, I m trying to create a flat file with a header in it. Everything looks good, but column names and the header are coming in the same row. I want header row on top and then column names and data. How can I do this?

    Is this just a matter of a missing EOL delimiter? (Either <CR> or <CR><LF> depending on your flat file)

  • Hi, Could you please attach or paste a sample of what the flat file should look like?

    Regards,

    Iulian

  • Sample file looks like:

    Header:

    Column A Column B Column C

    333 333 333

    From the above, Header is constant, Column names and then data.

  • I think it should work using bcp:

    http://msdn.microsoft.com/en-us/library/ms162802.aspx

    What export method are you using at the moment?

    Please send also a sample of the script/code you use.

    Reagrds,

    Iulian

  • ssismaddy (9/22/2011)


    Hi, I m trying to create a flat file with a header in it. Everything looks good, but column names and the header are coming in the same row. I want header row on top and then column names and data. How can I do this?

    Thank you

    You need the header in the file when you configure the Flat File destination during development so when you test SSIS keeps the header and send it out anytime you run it. I have run into this issue many times, if you did not provide the header SSIS always return only the data in the rows.

    Kind regards,
    Gift Peddie

  • Hi ,

    You need to check the column name in the first data row field option and make sure that header row delimiter should taken as {CR}{LF}

    I think it helps...

    _______________________________________________________________

    Need help? Help us help you.

  • tommey152 (9/28/2011)


    Hi ,

    You need to check the column name in the first data row field option and make sure that header row delimiter should taken as {CR}{LF}

    I think it helps...

    In 2005 which is my production server it does not help the only other way is to use configuration that turns header on and off in a stored procedure. The file with header is no code required option.

    Kind regards,
    Gift Peddie

  • You can use a "no code" solution that is built into the SQL 2005 SSIS. There is an option on the first tab of the flat file connector that gives you the ability, if checked, to dump the headers and data into a flat file (text file or csv file). If that check box is unchecked, then all you get in the file is the data.

  • prescientdba (9/29/2011)


    You can use a "no code" solution that is built into the SQL 2005 SSIS. There is an option on the first tab of the flat file connector that gives you the ability, if checked, to dump the headers and data into a flat file (text file or csv file). If that check box is unchecked, then all you get in the file is the data.

    That option is clicked by default in all my packages and no it does not add the header in my results file, only a test file with header returns header. This may be a bug in 2005 but I can say any development that I leave out the header in the test, I had to go back and run test with header to get the header.

    Kind regards,
    Gift Peddie

Viewing 10 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic. Login to reply