Link to home
Start Free TrialLog in
Avatar of tovvenki
tovvenki

asked on

Delete Nodes in an Hierarchy

Hi,
I have a table with the following columns

id int
name varchar
parent id

this table is used to create a tree structure of any level deep. Now I want to create a procedure/function that gets the node id as a parameter and deletes all its children till the end. Under the passed node id there can be any level of nodes...sub nodes ...etc.

can anyone please point me to an article or procedure/function that does this.

Thanks in advance
Venki

ASKER CERTIFIED SOLUTION
Avatar of imran_fast
imran_fast

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of tovvenki
tovvenki

ASKER

Hi,
Thnaks for the prompt reply, but can you give some additional information on the the session no column, how it gets its value, whether the application send this id or...??

Thanks
venki
>>session no column, how it gets its value,

Session No is to track the sessions  for example you have 3 users working on search so each user should have one session no. Now this session no could be user_name. and it shuold be passed by the application .