Quarksoft Blog

This is where we post useful information for everyone. Lots of it is technical, but some can be used by anyone.

Pivots with Dynamic Columns in SQL Server 2005

<< Some more command line fun - sending email  Disabling buttons on click for ASP.NET forms >>

Found a great article at www.simple-talk.com which described how to create pivot queries with dynamic column names.  It seems simple at first until you try to adjust your columns manually and then discover that you really need to implement some special code to accomplish the task.  The article Pivots with Dynamic Columns in SQL Server 2005 provides just the right information to accomplish the task and saved me a ton of time trying to create the process on my own.  Great job Andras.

2 Responses to “Pivots with Dynamic Columns in SQL Server 2005”

  • Ferenc says:

    Dear Andras!

    For me isn’t working. :(
    It is said The name ‘Select …’ is not a valid identifier.

    When I copy the @query content SQL syntax, and run in a new query it’s completted succesfully.

    Can you help me?

  • quarksoft says:

    Can you post the code you used? It sounds like you just have some quotes missing or something like that.

Leave a Reply