• Thanks to everybody!!!; I was testing this script in SQL Server 2005 and everthing is ok.

    //>>>>

    DECLARE @lValueStr VARCHAR(MAX)

    SET @lValueStr = NULL

    SELECT @lValueStr = COALESCE(@lValueStr + ', ', '')

    + a.Cod_Asignatura + '(' + CAST(rtrim(ltrim(b.Des_Asignatura)) AS VARCHAR(30)) + ')'

    FROM pla_tt_PlanificacionDetAsig a inner join pla_tc_Asignatura b

    on a.cod_empresa = b.cod_empresa

    and a.cod_recinto = b.cod_recinto

    and a.cod_asignatura = b.cod_asignatura

    SELECT @lValueStr

    <<<<//

    I Really don't understan how it work, but just work and good! 🙂 :w00t:

    Best regards.