hello i have a table with four fields : name_id, name, tree_id, level with
these data:
1 name1 001 1
2 name2 002 1
3 name3 003 1
4 name4 001001 2
5 name5 001002 2
6 name6 001003 2
7 name7 001001001 3
tree:
1-
- 4
-7
-5
-6
2-
3-
and procedure which add nodes to tree looks tree.add(idparent,idchild,name)
how to write select which returns idparent,idchild and name then i can add
nodes in loop reading datareader ? 4 2167
sorrry i forgot one think the select should return somethin like :
root 1 name1
root 2 name2
root 3 name3
4 1 name4
5 1 name5
6 1 name6
7 4 name7
Użytkownik "ven" <ve*****@poczta.onet.pl> napisał w wiadomo¶ci
news:dk**********@news.onet.pl... hello i have a table with four fields : name_id, name, tree_id, level with these data:
1 name1 001 1 2 name2 002 1 3 name3 003 1 4 name4 001001 2 5 name5 001002 2 6 name6 001003 2 7 name7 001001001 3
tree:
1- - 4 -7 -5 -6 2- 3-
and procedure which add nodes to tree looks tree.add(idparent,idchild,name)
how to write select which returns idparent,idchild and name then i can add nodes in loop reading datareader ?
ven (ve*****@poczta.onet.pl) writes: hello i have a table with four fields : name_id, name, tree_id, level with these data:
1 name1 001 1 2 name2 002 1 3 name3 003 1 4 name4 001001 2 5 name5 001002 2 6 name6 001003 2 7 name7 001001001 3
tree:
1- - 4 -7 -5 -6 2- 3-
and procedure which add nodes to tree looks tree.add(idparent,idchild,name)
how to write select which returns idparent,idchild and name
Since I answered a similar query earlier this week, I'm lazy and refer
you to that thread: http://groups.google.com/group/comp....9fcc60b9ca2ed1
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se
Books Online for SQL Server SP3 at http://www.microsoft.com/sql/techinf...2000/books.asp
You might want to look at the Nested Sets model for trees instead.
The nested set method you will see is:-
1) Difficult to maintain
2) Does not scale nor perform well out of the lab and in the real
world.
A better method is that developed by Itzik Ben Gan, information here: http://www.windowsitpro.com/Articles...layTab=Article
--
Tony Rogerson
SQL Server MVP http://sqlserverfaq.com - free video tutorials
"ven" <ve*****@poczta.onet.pl> wrote in message
news:dk**********@news.onet.pl... hello i have a table with four fields : name_id, name, tree_id, level with these data:
1 name1 001 1 2 name2 002 1 3 name3 003 1 4 name4 001001 2 5 name5 001002 2 6 name6 001003 2 7 name7 001001001 3
tree:
1- - 4 -7 -5 -6 2- 3-
and procedure which add nodes to tree looks tree.add(idparent,idchild,name)
how to write select which returns idparent,idchild and name then i can add nodes in loop reading datareader ? This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: imani_technology_spam |
last post by:
We need to present hierarchical data on a web page, the same way the
tree view shows files in Windows Explorer. Here's the catch: that
tree view needs to be bound to a SQL Server database. How...
|
by: ragha |
last post by:
Dear friends
I am emulating thr tree structure mentioned in the article
http://www.15seconds.com/issue/010921.htm
I have succesfully created the folder structure for level 2 I need
this...
|
by: Jean-Christophe Michel |
last post by:
Hi,
In a complex merging of two (non ordered) xml files
i need to keep track of the elements of the second tree that were already
merged with first tree, to copy only unused elements at the end....
|
by: Robin Tucker |
last post by:
Hi,
I'm currently implementing a database with a tree structure in a table. The
nodes in the tree are stored as records with a column called "Parent". The
root of the tree has a "NULL" parent....
|
by: Christian Fowler |
last post by:
I have a VERY LARGE pile of geographic data that I am importing into a database (db of choice is postgres,
though may hop to oracle if necessary). The data is strictly hierarchical - each node has...
|
by: Stephan Tobies |
last post by:
Hi everyone,
I am looking for a good data structure that could be used to represent
families of trees with shared sub-trees and copy-on-write semantics.
On a very abstract level, I would like...
|
by: Ken |
last post by:
I have a binary tree in VB NET and insertions seem to be slow.
The program receives data from one source and inserts it into the tree.
The program receives data from another source and...
|
by: hankypan1 |
last post by:
Hi All,
I need a tree data structure for my application. It is the non -cyclic
simple tree where i can have any number of children node and each
child can recursively become a sub tree like a...
|
by: =?ISO-8859-1?Q?m=E9choui?= |
last post by:
Problem:
- You have tree structure (XML-like) that you don't want to create
100% in memory, because it just takes too long (for instance, you need
a http request to request the information from...
|
by: smarttechie |
last post by:
Hii all please help its urgent
i have developed an application in xsl. what i want to do is i m searching the xml file based on a search.and based on that search im creating one tree like...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |