sql server 2017 STRING_AGG() 替代方案
SELECT @StuId='"'+STRING_AGG(Id,'","')+'"'FROM( SELECT 'a'+cast(Id as varchar) Id from Student) AS TEStudent
可以用以下替代
set @StuId=STUFF((select ','+Id from ( SELECT 'a'+cast(Id as varchar) Id from Student) as T FOR XML PATH('')),1,1,'')