|
Posted by Erland Sommarskog on 06/07/05 16:03
Sam (samuel.berthelot@voila.fr) writes:
> I would like a piece of advice.
> I have 3 foreign keys in a table used as primary keys for this table.
> Is it useful in that case to have just one identity column that would
> be used as the unique primary key, thus no need to have 3 primary keys
> ?
> Advantages vs Drabacks ?
Sometimes this makes things easier. Sometimes it makes things more
difficult.
The advantage with the IDENTITY column are more directly apparent with
less typing and all that. The disadvantages are more subtle but once you
run into them, you often find that they are more serious.
Thus, unless there is a special reason for it, do not use a surrogate key.
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp
Navigation:
[Reply to this message]
|