SQL server converts multiple lines into one line, separated by characters

		SELECT
		STUFF(
			(
			SELECT
				',' + CONVERT ( VARCHAR ( 10 ), ichr_high_risk_item ) --, 合并后的分隔符   ichr_high_risk_item  需要合并的字段
			FROM
				initialcarehighrisk --Table Name
				where woma_healthno=''  --condition, if none will to merge all data
			  FOR xml path ( '' ) 
			),
			1,
			1,
			'' 
		) 

Read More: