SQL Server Transact Basic to Expert - Select Query with Comma Delimited values

This blog shows how to get a result set separated with comma delimited values with the select statement

Example:

Declare @Tempstring varchar(100)
@Tempstring = ''

select @Tempstring = @tempstring + Empname + '-'
From emptable
Where empsal > 1000

Select @Tempstring

Result:
Karthik-Arun-Arvind