O que você quer se chama
UNPIVOT
e feito assim:select id,field,value from
#document_fields
unpivot
(
value
for field in (x,y,z)
) as u
order by id,field
Demonstração
UNPIVOT
e feito assim:select id,field,value from
#document_fields
unpivot
(
value
for field in (x,y,z)
) as u
order by id,field