SELECT REPLACE( REPLACE((SELECT Name FROM common.Common_Setup_CompanyData T WHERE CompanyID<39 FOR XML AUTO),'<T Name="',','),'"/>',',')
DECLARE @dd NVARCHAR(1000)
SET @dd=( SELECT REPLACE((SELECT Name FROM common.Common_Setup_CompanyData T WHERE CompanyID<39 FOR XML AUTO),'<T Name="',',') )
SET @dd= REPLACE(@dd,'"/>','')
SELECT Stuff(@dd,1,1,'')