October 22, 2009 06:22 PM
Pivoting the Dynamic Way
How to work around PIVOT's column constraint
Rating:

(2)
SQL Server Magazine
InstantDoc ID #102722
Executive Summary: T-SQL's PIVOT statement, which was introduced in Microsoft SQL Server 2005, has one key limitation: You must know about and include all the PIVOT column names in the PIVOT query. Creating a script that will work regardless of any new columns might seem impossible, but it's not. You just need to follow a two-step technique to achieve dynamic pivoting. |
...
You must be a paid Professional Member to access this entire article.
Already a Professional Member? Please log in now: