title: How to display the all records of table as columns in sql query?
body: <p>I have a table with 200 records so i need to show all 200 rows as 200 columns it is not possible to write all 200 records in pivot IN() section as when i insert 201st record in table its column should also to be shown.</p>
  
  <pre><code>select * from Table_Name 
  </code></pre>
  
  <p>Returns 200 rows</p>
  
  <p>so i need to show 200 columns in other queries</p>
  
  <pre><code>SELECT * FROM
  (
  select RecordName from Table_Name
  ) AS T
  PIVOT (Max(RecordName) FOR MiscMasterName IN (Record1,Record2)) AS T2
  </code></pre>
  
  <p>gives 2 columns
  like wise i need 200 columns such that if i add 201st records
  and wherever i execute the query i get 201 columns after inserting new record....</p>