I have a scenario as follows:
ManufacturerID Name
1 XXX
2 YYY
DeptID Name ManufacturerID
1 abc 1
2 bcd 1
3 efg 2
ProductID name deptid
1 dfdfg 1
2 dfdg 2
3 sdfsd 2
PartsID name productid
1 sdf开发者_JAVA百科s 1
2 sfdfs 2
3 sdd 1
I want the above table structure to be made as hierarchical using levels. How do I design the table?
I cannot understand what hierarchy you need to make, but if you're using sql server 2008 please take a look at hierachyId datatype. And please provide more desdcription about you process. Now it looks straightforward:
Manufacturer has many departments, department has many products, product has many parts.
精彩评论