title: Dynamic Pivot Columns in SQL Server
body: <p><br />
  I have a table named Property with following columns in SQL Server:<br /></p>
  
  <pre><code>Id    Name
  </code></pre>
  
  <p>there are some property in this table that certain object in other table should give value to it.</p>
  
  <pre><code>Id    Object_Id    Property_Id    Value
  </code></pre>
  
  <p>I want to make a pivot table like below that has one column for each property I've declared in 1'st table:</p>
  
  <pre><code>Object_Id    Property1    Property2    Property3    ...
  </code></pre>
  
  <p>I want to know how can I get columns of pivot dynamically from table. Because the rows in 1'st table will change.</p>