select F_CourseIds=''''+F_CourseIds+'''' from StudentCourse SELECT STUFF((SELECT ','+name FROM 表名 for xml path('')),1,1,'')