title: SSIS Auto Mapping to OLE DB Destination
body: <p>I am wondering if a solution to the following problem exists in SSIS.</p>
  
  <p>I have 2 column table (ID and Name fields) that I create a 3rd column for with a SQL script task, called filename. This only is created if the column doesn't already exist. My package is displayed below at both the control at data flow levels.</p>
  
  <p>My package will create the column "Filename" just fine if it doesn't exist, but instead of pulling the name of the file correctly in the loop, it will be all null as the "Filename" wasn't mapped to the destination (as it didn't exist before). I can easily fix this by simply going to the destination and mapping the Filename from the loop to the "Filename" column that was created, but this means I have to re-run the package.</p>
  
  <p>My core question, is there a way for SSIS to automap my variable that contains the filename to the destination column "Filename" that gets created outside the loop? Or do I have to manually map that thing every time I work with a table that didn't have the column in there when I ran the package.</p>
  
  <p>Thanks,</p>
  
  <p><a href="https://i.stack.imgur.com/58ync.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/58ync.jpg" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/bGQfC.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bGQfC.jpg" alt="enter image description here"></a></p>