It sounds like you are enforcing a 1 to 1 restriction but storing the 
link in a 1 to many or many to many db design. If table1 can only ever 
be linked to 1 table2 record and vice versa, wouldnt it be easier to 
store the table1ID in the table2 as a field (or vice versa)? All your 
queries would have 1 less join, etc.

Aaron

Saturday (Stuart Kidd) wrote:

>Hi Jordan,
>
>Yes, more than one field needs to be a primary key.  I'm using MS-SQL  
>(on shared hosting).
>
>Stuart
>
>
>On 14 Jul 2005, at 23:07, Jordan Michaels wrote:
>
>  
>
>>Saturday (Stuart Kidd) wrote:
>>
>>
>>    
>>
>>>Hi guys,
>>>
>>>I want to add a row in a join table which i don't want to be
>>>duplicated ever.
>>>
>>>So i have my tableID, table1ID, table2ID - if table1ID = 24 and
>>>table2ID = 35 i don't want there to ever be a reoccurence of them.  I
>>>guess i have to set both of those fields (table1ID, table2ID) to
>>>primary keys, but how can i do that?  Do i do it in ms-sql or via
>>>Coldfusion somehow?  If i do it via MS-SQL then won't it pop an error
>>>up in the code if it happens?
>>>
>>>Thanks,
>>>
>>>Saturday
>>>
>>>
>>>
>>>      
>>>
>>Are you talking about compound keys? Where more then one field is the
>>primary key?  This can be done in most databases - even access if I
>>remember correctly.
>>
>>-JM
>>
>>-- 
>>Warm regards,
>>Jordan Michaels
>>Vivio Technologies
>>http://www.viviotech.net/
>>[EMAIL PROTECTED]
>>
>>
>>    
>>
>
>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:211933
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=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to