I am setting up a database in SQL Server that will hold a sales team
listings.  The salesperson can be in multiple categories and multiple
states.  My question is what is the most efficient way of doing this? would
it be....

(1) setting up three tables, one for the salesperson's main record and one
which contains the categories they are in and one that contains the states
they are in.

(2) creating a unique record for each category/state they are in, something
like

<cfset categoryCount = LISTLEN(categories)>
<cfset stateCount        = LISTLEN(states)>

<cfif stateCount GT categoryCount>
        <cfloop index="s" list="#states#">
                <cfloop index="c" list="#categories#">
                        <cfquery name="name" datasource="ds" dbtype="ODBC">
                        INSERT INTO blah blah
                        </cfquery>
                </cfloop>
        </cfloop>
<cfelse>
        <cfloop index="c" list="#categories#">
                <cfloop index="s" list="#states#">
                        <cfquery name="name" datasource="ds" dbtype="ODBC">
                        INSERT INTO blah blah
                        </cfquery>
                </cfloop>
        </cfloop>
</cfif>



(3) or am I missing another option?????

any feedback is appreciated.

G


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to