Puoi ancora usare la funzione PIVOT per ottenere il risultato, ma poiché stai aggregando un varchar
devi usare o max
o min
:
SELECT *
FROM
(
SELECT [c_id]
,[c_lname] as [Apellido]
,[c_fname] as [Nombre]
,[c_nick_name] as [documento]
,[ut_text]
,f.ug_label
FROM [pegasys].[dbo].[cardholder] c
inner join [pegasys].[dbo].[udftext] u on c.c_id = u.ut_cardholder_id
inner join [pegasys].[dbo].[udfgen] f on u.ut_udfgen_id = f.ug_id
) d
PIVOT
(
max(ut_text)
FOR UG_LABEL IN ([Torre], [Cuit], [Empresa], [Departamento])
) p