What is the maximum number of columns that can be used for creating a composite primary key?
An Oracle index, which is the structure that supports the Primary Key constraint, can have a maximum of 32 columns. This should be plenty to define your table's Primary Key. If it is not sufficient, then one might need to rethink the table design.
For More Information
- Dozens more answers to tough Oracle questions from Brian Peasland are available.
- The Best Oracle Web Links: tips, tutorials, scripts, and more.
- Have an Oracle or SQL tip to offer your fellow DBAs and developers? The best tips submitted will receive a cool prize. Submit your tip today!
- Ask your technical Oracle and SQL questions -- or help out your peers by answering them -- in our live discussion forums.
- Ask the Experts yourself: Our SQL, database design, Oracle, SQL Server, DB2, metadata, object-oriented and data warehousing gurus are waiting to answer your toughest questions.