I've got a table that's a working copy subset of a base table. The base table has a composite key with a clustered index. However I need a single column unique identifier for my framework to work with the table. Both keys are completely unique, and I'll need to make a clustered, unique index on the original, composite key.
Should I keep the composite key as a clustered primary key, or should I use the single column identifier as a non-clustered primary key? Though my framework requires a single identifying column I don't actually have to specify it as the primary key in the DB layer, so I'm not sure which is preferable.
I'm using SQL Server 2005 and the single column identifier will be an IDENTITY.
IDENTITYas a FK? – JNK♦ Feb 10 '12 at 17:45IDENTITYdoesn't exist in my source table. So far as I've designed, theIDENTITYis never used except to update rows via the framework. Queries make extensive use of the composite key though, hence the clustered index to match the source table. – Ben Brocka Feb 10 '12 at 17:54JOINor query it there's no point in doing anything else to that field. – JNK♦ Feb 10 '12 at 17:59