How to concatenate rows into a varchar parameter in a Stored Procedure?

Database
Enthusiast

How to concatenate rows into a varchar parameter in a Stored Procedure?


Hi ,

I would like to concatenate a column data (multi rows) into one string inside a Stored Procedure.

I’ve succeeded getting what I want using CTE (with recursive) but I can’t use it in my SP.

Is there a way to use CTE within a Stored Procedure?

If not - Is there a way of achieving that in any other way?

Thanks

Sharon