SQL Fiddle
MS SQL Server 2008 Schema Setup:
CREATE TABLE tblUsers
([name] varchar(7))
;
INSERT INTO tblUsers
([name])
VALUES
('asieh'),
('amir'),
('safoora')
;
Query 1:
SELECT STUFF((
select ','+ name
from tblUsers
FOR XML PATH('')
)
,1,1,'') AS names
Results:
| NAMES |
|--------------------|
| asieh,amir,safoora |