Home | User-Defined Functions | Tips & Tricks | SQL Server 2005 | Forums | Frequently Asked Questions | Practice Test |    
SQL Server Helper Forum
SQL Server Helper Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000/2005
 General
 Want help In Recursive Function to Count,,,,
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

ashishashish

India
3 Posts

Posted - 09/11/2008 :  00:38:45  Show Profile  Reply with Quote
Hii,,,i have n problem i want a store procedure in which a recursive function is present which returns the count of the records,,,,
The scenario is like this,,,,
A parent Node Has Only TWo Child Node,,,so its repeated again n again,,,so i want the count by the recursive Function,,,for that,,
help in this,,,
A
/ b c
/ \ / d e f g


n more the thing is like that,,,,,i i want the count on every node,,,or the specific node on which i wnt,,,from the recursive function ...in Sql server 2000////////

ashishashish

India
3 Posts

Posted - 09/11/2008 :  01:17:16  Show Profile  Reply with Quote
Sorry...
Its Seems Like That...
So take a look n help guys,,,

Hii,,,i have n problem i want a store procedure in which a recursive function is present which returns the count of the records,,,,
The scenario is like this,,,,
A parent Node Has Only TWo Child Node,,,so its repeated again n again,,,so i want the count by the recursive Function,,,for that,,
help in this,,,
A
/ b c
/ \ /\
d e f g



n more the thing is like that,,,,,i i want the count on every node,,,or the specific node on which i wnt,,,from the recursive function ...in Sql server 2000////////
Go to Top of Page

sqlAdmin

72 Posts

Posted - 09/11/2008 :  07:39:41  Show Profile  Reply with Quote
Here's a couple of links that uses recursion where you can base your function to count the number of child records in your tree structure:

http://www.sql-server-helper.com/functions/get-tree-path.aspx
http://www.sql-server-helper.com/functions/get-tree-node-level.aspx
Go to Top of Page

ashishashish

India
3 Posts

Posted - 09/11/2008 :  22:59:11  Show Profile  Reply with Quote
Thanks..But my parents node allowed has maximum,,,2 child....than these two child can behave like parent node now they are allowed to have only 2 more child nodes if there is any,,,

Means....the introducer ID is repeated only two times in the data....
and not more than two time...so i have to sat a relation between this,,,,

Thanks,,,,,,
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
   
SQL Server Helper Forum © 2006 SQL Server Helper Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.06