October 19, 2010 at 5:06 am
Hi all,
Here is the table structure for managing a binary tree application
tbl_User_acc
( Userid int identity primary key, Parentid int, Agentid int)
Can anyone please let me know by using stored procedure, How to find out the parentid of a node based on Agentid field?
I need the data in the below given format
Userid Parentid Agentid
2 null null
3 2 2
4 null null
5 2 2
6 3 2
7 3 2
8 5 2
9 5 2
10 4 4
11 4 4
12 10 4
13 10 4
Please help me.I am in urgent.
Thanks in advance.
October 19, 2010 at 2:24 pm
There are plenty of people here that are willing and able to help however your question does not explain what you want clearly.
Please see this link[/url] for an example of how to post your question so that we are able to help.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply