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)
 Database Structure Opinions Required

Author  Topic 

timgaunt
Posting Yak Master

115 Posts

Posted - 2005-01-30 : 11:58:17
Hi,

I expect this has been asked before somewhere but I've had a bit of a look around and can't see anything.

Basically what I'm doing is writing a site which is going to have multiple levels of sub categores (like eBay if you like). In the past when writing a store with multiple categores I've written 2 tables in addition to the "products" table those are:

Categories:
CatID | Level1 | Level2 | Level3...
CatMatrix
CatID | ProdID

This method does have its complications so now I'm wondering if thats the best method to use and would be interested to know how others do it. Is it ok/correct to write it like that? If not how would it be best? Multiple Category/matrix tables?

Thanks in advance.

Tim

nr
SQLTeam MVY

12543 Posts

Posted - 2005-01-30 : 13:08:08
See
http://www.intelligententerprise.com/001020/celko.jhtml?_requestid=571016
http://www.mindsdoor.net/SQLTsql/RetrieveTreeHierarchy.html
http://www.sqlteam.com/item.asp?ItemID=8866

Do a search for trees and hierarchies
There's been lots written.


==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

timgaunt
Posting Yak Master

115 Posts

Posted - 2005-01-30 : 16:18:58
Ahhh, trees and hierarchies you see thats where I've been going wrong, thanks, I'll look into that.

tim
Go to Top of Page
   

- Advertisement -