Du kan prøve at bruge UNPIVOT, sådan her...
SELECT empid, empvalues
FROM (
select empid, addr, convert(varchar(100), sal) as sal, convert(varchar(100), doj, 103) as doj
from emp
) pv
UNPIVOT
(
empvalues
FOR ev in (addr, sal, doj)
) AS ev
producerer dette output...
Ressourcer til din reference...
https://codingsight.com/understanding-pivot-unpivot- and-reverse-pivot-statements/ https://docs.microsoft.com/en-us/sql/t-sql/queries/from-using-pivot-and-unpivot?view=sql-server-ver15