A query with UNPIVOT will look something like this.
SELECT * FROM TableName t UNPIVOT (Vals FOR N IN (Column1, Column2, Column3,....,Column10))up
It is important to note that all columns in an IN expression must have the same data type if they do not use a subquery to convert them to a homogeneous data type and then not open something like ...
SELECT * FROM ( SELECT CAST(Column1 AS VARCHAR(200)) AS Column1 ,CAST(Column2 AS VARCHAR(200)) AS Column2 ,CAST(Column3 AS VARCHAR(200)) AS Column3 ,..... ,CAST(Column10 AS VARCHAR(200)) AS Column10 FROM TableName) t UNPIVOT (Vals FOR N IN (Column1, Column2, Column3,....,Column10))up
source share