Alessandro Mortola graduated in Mathematics at the University of Genoa (Italy); during his career, he has always worked as a developer, analyst, database developer and DBA with an increasing interest in Sql Server with which he has been working since the 7.0 version. He is a Microsoft Certified Professional having earned the “SQL 2016 Database Development” certificate in 2018. He was one of the speakers in the Sql Satrurday's Editions in Parma 2018 and 2019. He sometimes writes articles for sqlservercentral.com. During his career, he has always been a person to refer to for his colleagues regarding data; he periodically carries out internal Sql Server courses for his company. Today he works in Zucchetti S.p.a. – BU Asset Management – mainly as DBA.
In this session we are going to analyse in detail the T-SQL PIVOT and UNPIVOT operators unveiling their characteristics and pros as well as drawbacks and pitfalls with the available workarounds. In addition, we are going to compare PIVOT and UNPIVOT operators with the standard SQL solutions pointing out differences in the execution plans, performance as well as in the code readability.