SQL unpivot using xml path

Often we come across to a point where we need the data to be unpivoted. SQL server has Pivot and Unpivot clauses in built though but that’s little difficult to use when we don’t have any aggregation to do. By standard xml streaming in sql server we can achieve the same as quick as possible with ease. Please refer below

sql-unpivot-using-xml-path
sql-unpivot-using-xml-path

Below is the query

Prasad Sahoo

Prasad Sahoo, is an enthusiast of Microsoft technologies in general and a passionate database professional, mainly focusing on SQL Server performance tuning and business intelligence. He has contributed a long time of his career working on SQL Server and other RDBMS. If he is not busy with SQL stuff then he must be watching some Hollywood movies.

Leave a Reply

%d bloggers like this: