• To Modify:

    DECLARE @var varchar(8000)

    SELECT @var = ISNULL(@var + '/') + FieldName

    FROM Table

    SELECT @Var

    However, this only works for one entity. For muliple entities the CTE recursion works fine, although it performs like crap. I only use this for throwaway SQL code generators where string handling in SQL makes sense.

    For a scalable solution where it makes sense to do this in SQL, you need to turn the recursion into iteration. Most CTE recursion can be re-written to be iterative, allowing a set based solution.

    Signature is NULL