Write custom messages to a text log file

  • I have an SSIS package and want/need to write meaningful comments to a text file. These comments might be "FTP Download started" or "Unzipping file xxxxxx" and need to be in plain language for my no techinal users.

    I currently do this via a Script task which opens the text file and writes a line to the file and I pass in a package variable which contains the message. I actually have a child package which does this and call it using the Execute Package task. This works fine.

    The problem is that I need to change the value of the package variable and the way I do this is to have another script task the set the value of the package variable.

    This seems overly complex for what I am trying to do. Is there a better way of doing this?

    Jez

  • You could use an OnPostExecute Event handler to write to the file. Either

    1. write to a string for each event and use a data flow to put to a flat file at the end of the package

    2. (what i would do) use a script to append on each event in a similar manner that you are doing at the moment, leaving only one script component per event.

    This is the most efficient way I can think of at the moment.

    Cheers

    Laurence

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

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