Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 modeling a recursive table in SQL Server

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2004-12-07 : 08:35:17
naturelover writes "I am not able to figure out a way to model a table which is related to itself multiple number of times. My table stores the parts of a product and can contain something like:



PartID | PartName
1 | Nut
2 | Screw
3 | Clip
4 | Plate
5 | Rod
6 | Handle
7 | Leg
8 | Tray

Assume:

Handle is made up of clip, nut and a screw
Leg is made up of handle, rods, nuts and screws
Tray is made up of plate, handles, nuts and screws

What would be the additional attributes needed in the table to represent:

nuts, screws and clip to be the sub parts for handle
handle, rods, nuts and screws to be the sub parts of leg
plate, handles, nuts and screws to be the sub parts of tray



Thanking you in advance..."

robvolk
Most Valuable Yak

15732 Posts

Posted - 2004-12-07 : 08:36:57
Assume: we don't answer homework questions, because we don't, because you won't learn anything if we did.
Go to Top of Page
   

- Advertisement -