Domanda

In my SSIS package I need to modify the flat file name that will get creted at the last step of my data flow execution. Currently, I need to transit input data though the Script Component + do a code modifications to a variable that will form a flat file component connection string. The actual data set that should be written is generated by Merge Join component and transiting it through the script component jsut to call one user variable adjustment seems like and overhead.

What is the best practice for an aforemention situation?

È stato utile?

Soluzione

If the file name doesn't depend on anything in the data, then I would use a Script Task in the control flow rather than a Script Component in the data flow to set the value.

If the file name does depend on something in the data, a Script Component is probably the best way to get that information; however, the Script Component cannot update any ReadWrite variables outside of the PostExecute method (which will not happen until all the input rows have been processed); this means that the variable changes will not be reflected in the output file's name. In this case, I'd suggest using a File System Task to rename the file after the data flow completes.

Altri suggerimenti

Personally I would use a rename DOS command afterwards. Export to a fixed filename and rename it afterwards. To me it's simpler.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top