• Anthony

    Just declare a variable and concatenate in one single SELECT statement, something like this (not tested):

    SET @MyVariable = ''

    SELECT @MyVariable = @MyVariable + ', ' + MyColumn

    FROM MyTable

    ORDER BY MyKeyColumn

    -- Remove leading comma

    SET @MyVariable = RIGHT(@MyVariable ,LEN(@MyVariable )-1)

    SELECT @MyVariable

    John

    Edit: I know I haven't declared the variable - something in the websweeper here won't allow that statement.