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.
select * from Table_Name
Returns 200 rows
so i need to show 200 columns in other queries
SELECT * FROM
(
select RecordName from Table_Name
) AS T
PIVOT (Max(RecordName) FOR MiscMasterName IN (Record1,Record2)) AS T2
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....