Hi All

I know this is a 'find out yourself in your environment...' type query, but
if I don't ask.....

Basically my query is whats the best ways IYHO to deal with categories (eg
Stock categories) for a ASP/DB app.

The 2 methods I have found are:

a) I create 1 table called CATEGORIES and 1 table called SUBCATEGORIES and
basically the SUB... table has an extra field to link it to a row in the
CAT... table.

I suppose this is your very basic option, which works, but is limited to 2
levels of categories.

b) My second idea was to have 1 CATEGORIES table as follows:

CATID
CATNAME
LEVEL

The LEVEL field is so that if the user specifies that the category they are
creating is part of another Category then I put the CATID of the cat into
LEVEL. This 'should' give me virtually unlimited levels as follows:

1st cat created = TELECOMS (no LEVEL entry)
2nd cat created = MOBILES (id of TELECOMS in LEVEL entry)
3rd cat created = ORANGE (id of MOBILES in LEVEL entry)
etc... etc...

Each time they create a new entry, I give them the option to select the
level in each they wish to put their cat, eg

Root level << this makes it a 1st level cat and therefore I leave the LEVEL
blank
TELECOMS
MOBILES
ORANGE << I check that the category they are creating is not the same as
the one they have specified so I don't get any duplicates

Only problems I foresee with this are:

a) A recursive could be created if the user is hell bent on confusion, but
more likely thick.

b) To actually use these categories to say put stock items in at different
levels may produce a massive <SELECT> list that I can indent, but could
still be huge.

Has anybody used the above and found pluses and minuses to it?

Do you use a better method?

Regards

Robbie