Thank this author by sharing:
By Edgardo Valdez,
Possible to create a table with a @param containing the number od columns to create?
Pivot with dynamic number of columns
Create serial numbers for sub category items
Creating Dynamic Columns in SSRS 2008
Help required to build from a DAT file with inconsistent number of columns to a fixed number of colu...
As a member of SQLServerCentral, you get free access to loads of fresh content: thousands
of articles and SQL scripts, a library of free eBooks, a weekly database news roundup,
a great Q & A platform… And it’s our huge, buzzing community of SQL Server Professionals
that makes it such a success.