1. We have moved to a new forum! There may be a few things not working properly so please let us know if you find a bug. Remember to use the bbCode [ sql ] tag for SQL statements.

How to declare Composite Keys?

Discussion in 'SQL - Questions and Answers' started by irfanhab, May 29, 2006.

  1. irfanhab New Member

    Dialect: SQL 92
    Say I have a table where the primary key consists of two attributes, how do I denote this constraint in SQL?
  2. irfanhab New Member

    Dialect: SQL 92
    SQL:

    ALTER TABLE tablename
    ADD CONSTRAINT constraint_name
    PRIMARY KEY (attribute1,attribute2)

Share This Page