Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

SQL SERVER xquery count child nodes

This will count the number of Colors nodes which is 1.

select @MyXML.value('count(/SampleXML/Colors)', 'int')

This will count the number of rows in Colors which is 5.

select @MyXML.value('count(/SampleXML/Colors/*)', 'int')
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #SQL #SERVER #xquery #count #child #nodes
ADD COMMENT
Topic
Name
7+5 =