You are here: Re: identity column « MsSQL Server « IT news, forums, messages
Re: identity column

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация