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)
 Displaying the whole category tree in a parent - children table

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-02-01 : 23:36:55
Ascii255 writes "My question goes like this:

I have 2 tables. One tb_product and one tb_category. Each product in belongs to a category. My problem starts when I would like to display the whole category name above the product.
An example and you'll understand better.

Lets say I am displaying a 21" TV, and the tv belongs to the category TV. The category TV has a parent Audio-Video, and AV has a parent Electronics, and finally electronics have the parent Home Stuff.
(the tree goes like this)

Home Stuff
|Electronics
--|AV
----|TV
-----|21"TV

In the asp I work with, I would like to display

Home Stuff > Electronics > AV > TV > 21"TV
Sony - 21"TV

I wrote a sp to give me the categories but imagine a page with hundreds of thousand users each day, and hundreds of categories. I believe the sql server would die or burn. So I need some help. How should I plan my table, so that displaying the categories will be the easiest? Or should I maintain my current table but use some special query?

I believe this category thing would help everybody.

Thanks A lot.
Ascii255"
   

- Advertisement -