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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add Constraint Syntax 1

Status
Not open for further replies.
Feb 25, 2008
46
US


I have a table with no primary key.

I want to assign a primary key to a field with ID numbers.

I tried the following ALTER table syntax >>

ALTER TABLE [table name] ADD CONSTRAINT [ID number] UNIQUE

('ID number' is the column name I want to make the primary key)

I keep getting this error >>

"syntax error in CONSTRAINT clause"

Please suggest the correct syntax.

Thanks in advance,
Mark.

 
ALTER TABLE [table name] ADD CONSTRAINT [constraint name] UNIQUE ([ID number])

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top