title: Dynamic Pivot result into fixed table (SSIS or SQL)
body: <p>I got a stored procedure, which gives me data by a dynamic pivot and I want to insert this data into a table, which has all possible columns, the dynamic pivot could produce.</p>
  
  <p>Example:</p>
  
  <p>The dynamic pivot stored procedure gives the following table as result:</p>
  
  <pre><code>Property_A  Property_C
  ----------------------
  Value_A     Value_A
  Value_B     Value_C
  ...
  </code></pre>
  
  <p>On another run the same SP may produce</p>
  
  <pre><code>Property_A  Property_B
  ----------------------
  Value_D     Value_A
  ...
  </code></pre>
  
  <p>Whatever it returns, the result should be put into a table like this</p>
  
  <pre><code>Property_A  Property_B  Property_C
  ----------------------------------
  Value_A     NULL        Value_A
  Value_B     NULL        Value_C
  Value_D     Value_A     NULL
  </code></pre>
  
  <p>and so on.</p>
  
  <p>How can I achieve this via SQL (MS SQL Server) or better via SSIS? </p>
  
  <p>Thanks in advance,</p>
  
  <p>tombom</p>