You can use T-Sql’s COALESCE function to combine your data into a single string. Here is a simple sample:
DECLARE @str VARCHAR(100)
SELECT @str = COALESCE(@str + '|', '') + Firstname
FROM Members with(nolock)
Print @str
Result:
Ilbay|Talha|Roberte|Theıoden|Cihan|Sagolee|Kazım|Mehmet|Recep|Alp|Haci|Ömer
Happy coding…