Creating Composite key

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • prileep
    New Member
    • Jan 2007
    • 20

    Creating Composite key

    I have a table "Transactio n" with the following struct

    Transaction
    TransactionID int primary key,
    CustomerID int,
    TranTime DateTime
    ----------------------------------------------------------------
    How can i set a composite key between CustomerID and TranTime
  • ronverdonk
    Recognized Expert Specialist
    • Jul 2006
    • 4259

    #2
    You mean in the table definition itself? Like this
    Code:
    ALTER TABLE table ADD COLUMN comp_key varchar(20) AFTER CustomerID;
    Ronald :cool:

    Comment

    Working...