Reply to Re: Sequence of columns in primary key

Your name:

Reply:


Posted by Erland Sommarskog on 10/18/05 14:08

(gilles27@talk21.com) writes:
> You're right to say that Ledger is the "main" key. I should have
> explained but it looks like you figured it out yourself. I also
> incorrectly stated the current column order in the PK. It is Ledger,
> OrderLineNumber, OrderNumber and NOT Ledger, OrderNumber,
> OrderLineNumber.

Assuming that OrderLineNumber refers to a detail line in an order,
having OrderLineNumber before OrderNumber sounds like someone had
a brainmelt. There is all reason to change that key.

(Unless queries like "Show me all line 5 on all orders in one ledger"
are common.)




--
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

[Back to original 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

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