Re: Best way to recursively populate a tree based on SQL Server 2000 b



Thanks Pete - Data's changes quite a bit so I need to stay realively live...

Mark
"The Greek" <The Greek@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:0EE9C6C4-81C4-43EB-92F8-5A1A6C2978DC@xxxxxxxxxxxxxxxx
> Mark,
>
> Reflective relationships can sometimes be a pain to deal with. If your
> data is slow changing I would highly reccommend using xml. You will still
> need to create your recursive stored procedure however instead of
> outputting
> a recordset you will be using the "for xml" clause. Once you return the
> xml,
> cache it and build your tree from the xml doc from now on. If your data
> changing all the time then you'll have to stick with running your sproc.
> There is a middle ground. You can also cache your results for a certain
> period (2 hours) and only hit the db every two hours for updates. The
> possiblities are endless and you'll have to decide what is the best fit
> for
> your design.
>
>
> Pete "The Greek" Orologas
> Neudesic Consulting
>
>
>
>
> "Mark" wrote:
>
>> Hi Folks
>>
>> I have a classic child parent relationship within the same table where an
>> unlimited number of levels is possible (theoretically). I have front-end
>> code that recursively populates a tree control by getting the children of
>> each node etc. etc. This makes potentially hundreds of calls to the
>> backend.
>>
>> What I would like to do (as I think it may be more efficient) is create a
>> single recursive stored procedure that returns all records in lineage
>> (text
>> description) order, i.e. top level first, then the first child, its
>> children
>> and so forth... I could then construct the tree by walking through the
>> data
>> in a single pass - I hope :@)
>>
>> Is this possible or is there a better / more appropriate way to achieve
>> the
>> same thing?
>>
>> I am trying to avoid multiple calls to the backend and at the same time
>> migrate the front end code to the sql server...
>>
>> Thanks very much
>>
>> Mark
>>
>>
>>


.



Relevant Pages

  • Re: TreeView with Recursive TreeNode....
    ... > XML would not be particularly helpful in this case. ... > As Mark says, a function to build up the tree nodes would still have to ... >> view of the data to recurse through then it would simplify the technique ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: If I could.. another MFC / UNicode question
    ... the BOM mark, and so it can be harmful. ... XML) have other ways to indicate what the encoding is. ... Byte Order Mark FAQ: ... Murphy's law, also known as Sod's law, states that if ...
    (microsoft.public.vc.mfc)
  • Re: Explorer crashing while navigating folders containing .xml fil
    ... Well Mark, you did it again!!! ... The icon for XML file association was broken, when I tried to change it, I ... Mark L. Ferguson MS-MVP ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: Ping Steve H.
    ... Steve Hawkins wrote: ... Were Pete, Mary, and Mark ... Mark and Pete split the show and Greta sang several tune with them. ... Concert Jumbo, just shy of 16" on the lower bout. ...
    (rec.music.makers.guitar.acoustic)
  • Re: XML + ASP
    ... Mark have managed to get the search phrase, and number of records back - ... >> Next make sure that xml.ResponseXML is returning a valid xml document. ...
    (microsoft.public.inetserver.asp.general)

Quantcast