Newbie: ZeroPad columns and format other columns before writing into Flatfile

  • Hi

    I am trying to access a table and get two columns that I zero pad and the others I format differently like date in datetime stamp and finally write it to a flat file.

    I m not sure how to proceed after linking the ole db source to ole db command. But this is what I think I should do: In the OLE DB Command task I should access a store procedure that creates a temporary table that stores all the changed column values. Then output it to the flatfile.

    Could someone tell me if this is rite or if there is a better way to accomplish this.

    Thank you

    Gomz

  • Do I understand you correctly that you're trying to use the OleDB Command object to do formatting on your data? If so, there is an easier way. Check out the Derived Column transformation instead - you can use expressions to perform all manner of formatting, including padding with zeroes, spaces, or manipulating date output formats. You can then connect the output of the Derived Column to your flat file destination.

    If you've not used expressions or the Derived Column transform before, take a look at Andy Leonard's blog post on the topic:

    http://sqlblog.com/blogs/andy_leonard/archive/2009/02/04/ssis-expression-language-and-the-derived-column-transformation.aspx

    hth,

    Tim

    Tim Mitchell, Microsoft Data Platform MVP
    Data Warehouse and ETL Consultant
    TimMitchell.net | @Tim_Mitchell | Tyleris.com
    ETL Best Practices

Viewing 2 posts - 1 through 1 (of 1 total)

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