September 8, 2011 at 8:29 am
It's ok.... cracked it.
-- Query to return the item nos.
SELECT
convert(int,convert(varchar(50),I.query('text()'))) AS Item
FROM
@tableToHoldXML
CROSS APPLY xmlDataColumn.nodes('/list/item') AS Items(I)
Although if there is a more elegant solution i'd love to hear some suggestions.
September 8, 2011 at 8:34 am
Also this
SELECT
I.value('(./text())[1]','int') AS Item
FROM
@tableToHoldXML
CROSS APPLY xmlDataColumn.nodes('/list/item') AS Items(I)
____________________________________________________
Deja View - The strange feeling that somewhere, sometime you've optimised this query before
How to get the best help on a forum
http://www.sqlservercentral.com/articles/Best+Practices/61537
September 8, 2011 at 9:18 am
Thanks, that's more what i was after. 🙂
Viewing 3 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply