sql-serverssissql-server-data-toolsssdt-bi

Add data from other object within SSIS package to populate a field for a table


There are many aspects of what I want to do but I think learning one piece will let me derive the rest.

I have an SSIS package that uses powershell to download a publicly available zip file, an execute script to unzip with 7zip and then data flows to load the unzipped files to corresponding tables.

What I want to do is add the file name (and eventually other aspects of the file like creation date, record counts and so on) from any one of the unzipped files to a log table that keeps track of the summary level details of the files.

How do I dynamically store this type of information as part of the package? Derived columns? But what's the input? Thanks!


Solution

  • There are many options for dynamically working with files through SSIS. Below is an overview of one method. Of course this can vary, depending on your specific needs and requirements.

    Sample SQL Insert:

    INSERT INTO YourDataBase.YourSchema.YourTable (ColumnToHoldFileName)
    VALUES (?)