Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ALTER TABLE - adding a constraint.

Status
Not open for further replies.

TimGoff

Technical User
Jul 16, 2002
166
GB
Hello,

I would like to add a Primary Key based on Columns House_Number & Prodn_code - but the below doesn't appear to work....anybody any ideas?

Thanks
Tim

ALTER TABLE tbl_bcst_t_ver ADD PRIMARY KEY House_Prod TAG House_Prod

ALTER TABLE tbl_bcst_t_ver ALTER COLUMN House_Number, Prodn_code CHAR PRIMARY KEY
 
Something like this ?
ALTER TABLE tbl_bcst_t_ver ADD CONSTRAINT ConstraintName PRIMARY KEY (House_Number, Prodn_code)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Works perfectly - thanks v much PHV.
Tim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top