> For what it's worth, there are seome cases where I use a varchar to 
> store a CSV list of flags.  I do this sometimes when I have 
> no need to 
> query on specific values.
> 
> For example, in my CMS, I store permissions to specific 
> modules in such 
> a field, which allows me to add modules without having to change the 
> default db structure for the user table.
> 
> I use a similar method in a large multipage form that may mutate from 
> time to time over the years.  There are 40-50 fields, some of 
> which are 
> multi-select lists, radio buttons, checkboxes.

This is the kind of thing I will create a separate table for.  For
example, using your example, you would have a permissions table.  All it
would have is the userid, a permission id, and the permission
description.  Then you just query that table using the userid and get
all records returned.  If you want them in a list, use ValueList().

Some people would take the above method a bit farther and have 3 tables.
Users, userPermissions, and permissions.  The permissions table has all
the distinct permissions for your site as unique records with an ID.
The userPermissions just has the userid and the permissionId.

You probably say, "What a waste of time, my method works and doesn't
have any problems!"  Well, you never know when there will come a time
that you wish you weren't storing those fields as a delimited list.
Remember how people in the 70's and 80's thought they'd never need to
store more than a 2 digit year?  Also, remember how Bill Gates thought
we'd never need more that 640k of RAM?  :)

Sorry, it's almost quitting time on a Friday and I'm babbling.  I'll
leave you all alone now.  :)


--------------


[INFO] -- Access Manager:
This transmission may contain information that is privileged, confidential 
and/or exempt from disclosure under applicable law.  If you are not the 
intended recipient, you are hereby notified that any disclosure, copying, 
distribution, or use of the information contained herein (including any 
reliance thereon) is STRICTLY PROHIBITED. If you received this transmission in 
error, please immediately contact the sender and destroy the material in its 
entirety, whether in electronic or hard copy format.  Thank you.   A2



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:235684
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to