advertisement
Login | Register   
  Include Code  Search Tips
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   TIP BANK
Browse DevX
Download the code for this article
Partners & Affiliates
advertisement
advertisement
advertisement
advertisement
 

Give the New PIVOT and UNPIVOT Commands in SQL Server 2005 a Whirl

Sometimes it's the little things that can simplify your life the most. Learn to combine SQL Server's PIVOT and UNPIVOT commands with Common Table Expressions to make your T-SQL code easier to read and produce more useful crosstabbed results. 


advertisement
any major product releases have a dizzyingly long list of new features and enhancements—often introduced atop a product that is in many cases so complex and feature-ridden that it's already difficult to keep up with the breadth of the product. However, the wide feature sets also mean that most developers find small nuggets of functionality that often have a significant impact on their jobs, if only to make life a little simpler. It is in these nuggets that I think many developers first come to appreciate new product releases.


For me, two particularly interesting new features of Microsoft's upcoming release of SQL Server 2005 are its new PIVOT and UNPIVOT commands. From a manager's perspective, pivoting provides a considerably simpler view of data, truly transforming it into information. From a developer's perspective, the features let you rotate row data into columns in the query response to create pivoted or "crosstabbed" views of query results.

It's quick, easy and you get access to all the articles on DevX.
This registration/login is to allow you to read articles on devx.com.
Already a member?



advertisement