I ask a question about sum node\'s values:
sum some xml nodes values in sql server 2008
Please consider this code:
Declare @xml xml
set @xml
Try this is working with BIGINT:
DECLARE @SearchKeyWords XML
SET @SearchKeyWords =
'
1000000000
234650
0
'
DECLARE @TempSearchKeyWords TABLE
(
SearchKeyWord BIGINT
)
INSERT INTO @TempSearchKeyWords
SELECT SearchKeyWords.SearchKeyword.value('.',' bigint ') AS SearchKeyword
FROM @SearchKeyWords.nodes('/Parent/Child') AS SearchKeyWords(SearchKeyword)
SELECT SUM(SearchKeyWord) FROM @TempSearchKeyWords