Overview

Here's another product suggestion I've logged with Microsoft along the same lines as the previous one.  This one is to allow you to dynamically specify the list of columns you want to unpivot.  This might be from a stored procedure parameter or a subquery, either way you can't do it easily at the moment.  Register your support here:

https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=332512

Detail

Current behaviour

UNPIVOT (value FOR column_name IN (Col1, Col2, Col3, Col4))

All columns must be known in advance and specified in full.

Suggested behaviour with subquery using a table-valued parameter

UNPIVOT (value FOR column_name IN (SELECT colname FROM @tblParam))

Columns can be determined at runtime.

Versions

  • SQL Server 2008
  • SQL Server 2005

Metadata

  • Categories: IT Management, Software Development, SQL Server
  • Additional keywords: UNPIVOT, dynamic column lists
  • Technorati Tags: , ,

Bookmark with :
Digg It! DZone StumbleUpon Technorati Reddit Del.icio.us Newsvine Furl Blinklist
posted @ Tuesday, March 11, 2008 12:36 PM | in SQL Server Software Development IT Management

Comments

No comments posted yet.

Post Comment

Title *
Name *
Email
Url
Comment *  


Please add 2 and 3 and type the answer here: