I have never used XML in SQL Server 2008, I need to extract a list of customers into a variable table how do you do it?
Given that I have a column called Custo
Try something like this:
SELECT
Cust.value('(ItemId)[1]', 'int') AS 'ItemID',
Cust.value('(Value)[1]', 'Varchar(50)') AS 'Customer Name'
FROM
dbo.Sales.CustomerList.nodes('/ArrayOfCustomers/Customer') AS AOC(Cust)
That should give you an output something like this:
ItemID Customer Name
1 Mr Smith
2 Mr Bloggs