Home Forums SQL Server 2005 Development Counting all childs and sub-childs of a node in tree RE: Counting all childs and sub-childs of a node in tree

  • thanks for replying dave.....

    Actually I have used recursive queries with some different scenarios in hierarchies. But here the case is little different i have to count all nodes, for this i will have traverse from top to bottom.

    In case of the example i have given in my question,

    from A i will have to search child nodes, which are B and C.

    then from B i will have to get D and E and from C have to find F, G and H. then again i will have to look for the child nodes of these nodes also.

    I tried the recursive query, but I didn't find any fruitful result.

    But ok, I will try it again. Thanks once again for reply.