My select query returns a list of 10 rows.
I tried use a COALESCE, but the exception throws "Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression."
My query:
DECLARE @sqlDetails NVARCHAR(MAX);
SET @sqlDetails = COALESCE( @sqlDetails + ' ', '') + ( SELECT
rp.RuleDetails
FROM
RuleBook rb,
RuleException re,
RuleParameters rp
WHERE
rb.RuleBookID = 57 AND
rb.RuleBookID = re.RuleBookID AND
rp.RuleBookID = re.RuleBookID AND
rp.RuleDetails NOT LIKE '%TRIGGER%' AND
rp.RuleDetails NOT LIKE '%EmailTo%');
I need concatenate the return into ONE single row, How I can do this?
Thanks.