Does anyone know how can I assign the multiple records from a select into one parameter in sql? Example:
I have the following select statement:
SELECT '|'+id+':'+rep
FROM dbo.reps
it will return the following result:
|1:tom
|2:amy
|3:ben
|4:ken
How can I assign those value into a parameter @rep and when I select @rept, it will display:
|1:tom|2:amy|3:ben|4:ken
will it possible?