I\'m using Microsoft SQL Server 2005.
I think I need a sub-query.
I\'m looking for one (1) row per customer, with the AvailableAction field be a concatenatio
For 2005+
SELECT CustID
, (SELECT ca.ActionID [@value]
, ActionName [text()]
FROM dbo.CustAction ca
INNER JOIN dbo.Action ON ca.ActionID = Action.ActionID
WHERE ca.CustID = c.CustID
FOR XML PATH('option'), TYPE) AvailableAction
FROM dbo.Cust c
I don't think you'll be able to get this with FOR XML EXPLICIT, so if this is 2000 you're out of luck (as far as simple solutions go).