I\'m tryin to use SQL to build a comma separated list of cat_id\'s
the code is:
declare @output varchar(max) set @output = null; select @
COALESCE Returns the first nonnull expression among its arguments
First argument @output + ', ' is never null (unless you initialize @output as null AND set CONCAT_NULL_YIELDS_NULL to ON), so it's always returned.
@output + ', '
@output
ON