[sql] For Xml Path

.Net 2008. 12. 17. 17:31 posted by 무명시인
select productid, (select cast(vendorid as varchar(10))+';' as [text()]
     from Purchasing.ProductVendor as o
     where o.productid = c.productid
     order by vendorid for xml path('')) as orders
from 
     Purchasing.ProductVendor as c group by productid ;