如果您修改了For Xml Path的用法,它将为您完成转义 *** 作,并且您无需诉诸使用Replace函数:
, Stuff( ( Select '; ' + IsNull( D2.SelectedComments, '' ) From #StudentDetails As D2 Where D2.Stud_PK = A.Stud_PK And D2.CourseNo = A.CourseNo And D2.Section = A.Section For Xml Path(''), type ).value('.', 'nvarchar(max)') , 1, 2, '') As SelectedComments
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)