title: SSIS - Pass variable in OleDB Command (Row Sampling to Update Existing Row)
body: <p>In OleDB command, how to pass the variable to update the table?</p>
  
  <p>I wanna use SSIS to load big volume of testing data, the file name and code are unique, but the other details could be repetitive (so I use row sampling to get the sample data).</p>
  
  <p>Table: MasterFile</p>
  
  <p>Columns: Name, Code, Reftag, AdminGroup, OrgUnits...</p>
  
  <ol>
  <li><p>As shown in control flow below, LoadNewMasterFile data flow will load the Name and Code to MasterFile table, which is unique</p></li>
  <li><p>Execute SQL task will get the Name and Code from the Master File and store as variable with script task.</p></li>
  <li><p>ForEachContainer will loop each code.</p></li>
  <li><p>Data Flow Task 1 is the one with Row Sampling, aim to retrieve one sample row and update column Reftag, AdminGroup, OrgUnits...</p></li>
  </ol>
  
  <p>Control Flow screenshot
  <a href="https://i.stack.imgur.com/PitPJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PitPJ.png" alt="enter image description here"></a></p>
  
  <p>In OleDB command, how to pass the variable to update the table?
  <a href="https://i.stack.imgur.com/dZRVO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dZRVO.png" alt="enter image description here"></a>
  <a href="https://i.stack.imgur.com/nXka4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nXka4.png" alt="enter image description here"></a></p>