Creating Header AND Footer to a flat file destination file

  • Hey jhon,

    Thanks, so much :-):-D

    It worked out. It solved my problem.

  • Hey, Is there a way that we can bold the headers for the flat file.

  • There was some problem yesterday and I was not able to view all your replies and was going on posting my problems..Sry about that

  • i have a job that is reverse of this topic but involves parsing out a ragged flat file details from the header and footer. there are two headers, two details, two footers.

    header1=Header000

    detail data

    footer1=Trlr 1111 records

    header2=Header000

    detail data

    footer2=Trlr 2222 records.

    How can I get the details into a Sql Table without the header and footer. The row delimited is crlf with no text qualifyer. I am having difficulty getting this to work. Any help appreciated.

  • Hi John Dempsey,

    All i want to say is AWESOME !!!

    AWESOME post saved lots of my time like a day or two.

    Thanks a LOT again..

  • paterjean (3/25/2011)


    Hi John Dempsey,

    All i want to say is AWESOME !!!

    AWESOME post saved lots of my time like a day or two.

    Thanks a LOT again..

    Your welcome, I'm glad I could help and thank you for the feedback it is appreciated. You demonstrate the reason SQL Server Central's community is so great.

  • This is really helpful...Thanks! But I have question,

    For Footer I used the script task to get the value, but how will be mapping of the footer be done to flat file dest? I dont know if I am missing something.

    Thanks in advance!

  • Hi John,

    Your post was very helpful, but I have a query,

    "You can create a SSIS variable to store your dynamically built header information, then assign it to the Header property of the Flat File Destination in the 1st Data Flow task"

    How do I implement this ?

  • monali154 (7/20/2011)


    This is really helpful...Thanks! But I have question,

    For Footer I used the script task to get the value, but how will be mapping of the footer be done to flat file dest? I dont know if I am missing something.

    Thanks in advance!

    Do you mean script task or script component in the data flow? If you mean you have the footer value in a variable and then added it to the data flow pipeline through the script component, your next step is to just wire the script component task in the data flow task to the Flat File Destination Connection with the footer layout. Please refer back to steps 5 & 6 in the original post.

  • mdkmohan (7/25/2011)


    Hi John,

    Your post was very helpful, but I have a query,

    "You can create a SSIS variable to store your dynamically built header information, then assign it to the Header property of the Flat File Destination in the 1st Data Flow task"

    How do I implement this ?

    I'm not sure I understand your question. Which part are you trying to implement? The following step after that statement, step #3, in the original post explains how to map the SSIS variable to the header property. Is this what you meant?

  • Thanks for your prompt response....

    Yes, how to map the SSIS variable to the header property? and I have another one too.

    How do I use the same SSIS package for different sql connections and different file destination paths ?

    Thanks in Advance

  • If you follow the original steps, they walk you through mapping the variable to the header.

    As for your question on the different sql connections and file paths, if the file layout is the same you can use Package Configurations to point to different connections and/or file paths. Please refer to Books Online for more info on SSIS package configurations.

  • Thanks for your information.

  • Hi

    I was reading your posting regarding creating headers and footer in a flat file. It helps me a lot.

    I am concern about the footer that i want to generate and then later append to the final file.

    I am not too much familiar with VB. I am using script component as a source in my second data flow.

    i have three variables whose values i want to append in the footer.

    Please advice me as how we can do this.

    Thanks

    Harry

  • Hi

    I am creating a header in flat file which is a destination as suggested by you in your post. i want to pass the record count in the header.

    I am creating an expression in the flat file connection manager properties. I am selecting 'HeaderRowDelimiter' in property box and experssion

    i am dragging my count variable (r1) as (DT_WSTR, 12)@[User::r1]. But when i am executing the package, i am getting file as:

    (DT_WSTR, 12)@[User::r1]

    1,store manager

    2,customer representative

    3,regional manager

    4,shift leader

    5,district manager

    Somehow it does not giving me the value of record count.

    Any suggestions as how to solve this problem

    Thanks

Viewing 15 posts - 16 through 30 (of 56 total)

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