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:

NOT A PROFESSIONAL MEMBER? YOU CHOOSE:

Monthly or Annual

Professional Membership

VIP Membership

Compare Member Benefits

Add a Comment

There are no comments to display. Be the first one!
You must log on before posting a comment.

Are you a new visitor? Register Here

Rename Virtual Server (Cluster)

I am going to rename a clustered instance (default).1. Change SQL Network Name2. Take offline3. Bring online4. Flush DNS, Cache5. Test failover6. Rebu...222-96209

GOOGLE LINKS
SPONSORED LINKS
FEATURED LINKS