-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 > Thank you for an excellent answer. I think I will have to study your > code for a while. But is it such a bad idea to have a separate column > for the primary key here? I see that there are two schools on this, > with diametrically opposed views. For my own part, I feel that it at > least doesn't hurt to have a surrogate key. Secondly, a single key > value is easier to reference from another table than a composite key.
Not "bad", but perhaps slightly inefficient and redundant. It depends on how your table is actually structured, but if the only way your app will ever refer to that table is in the context of those 2 foreign keys, then it makes sense to go ahead and make them a primary key. If there are other important fields in the table, /and/ if it is referenced from other tables, then I might add another column. But generally, this should be the exception and not the rule. - -- Greg Sabino Mullane [EMAIL PROTECTED] PGP Key: 0x14964AC8 200509122031 http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8 -----BEGIN PGP SIGNATURE----- iD8DBQFDJh99vJuQZxSWSsgRAiRFAJwKiGVsJhcbxIe0nQ3bnxJUZupucACgnUa/ 57e9UDfVkv/4AMp2wpqEa3c= =20d1 -----END PGP SIGNATURE----- ---------------------------(end of broadcast)--------------------------- TIP 5: don't forget to increase your free space map settings