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.
| Author |
Topic |
|
mike123
Master Smack Fu Yak Hacker
1462 Posts |
Posted - 2003-09-12 : 03:24:46
|
| I am attempting to design a db structure as followsTblZoneszoneID(identity),userID,websiteName,URL,description,categoryIDSample Data:1,1,sqlteam,www.sqlteam.com, best sql site on the net!,102,1,asp.net,www.asp.net,great asp.net resource site!,10The problem I am having is with the categoryID. So far what I have done is just insert the correct categoryID when a new row is inserted into the "tblZones"I have a "tblCategories" table as suchcategoryID, category1,Arts2,Gamesetc.So far everything is fine, but these categories so far are actually just sub-categories. I need to somehow relate this to a parent category. Whats the best or way to accomplish this?Should I add a "parentCategoryID" to the "tblCategories" ? Should I have a new table altogether featuring jsut "categoryID" and "parentCategoryID".Or should I altogether do it another way?I need to have a parentID for the categoryID. Where should I put this data? The reason I need to do this is because I need to run select statements according to the parent ID value.Thanks for any insightmike123 |
|
|
dsdeming
479 Posts |
Posted - 2003-09-12 : 08:19:52
|
quote: Should I add a "parentCategoryID" to the "tblCategories" ?
Yes. I would treat this the same way you would an employee table that contains managers and their employees.Dennis |
 |
|
|
|
|
|
|
|