[AccessD] Simple SQL Statement

Gustav Brock Gustav at cactus.dk
Fri Nov 3 08:42:18 CST 2006


Hi Gary

Try applying a name for the index:

ALTER TABLE tblClientMaster ADD CONSTRAINT IndexName UNIQUE (CCASE_NO);

or:

ALTER TABLE tblClientMaster ADD CONSTRAINT IndexName PRIMARY KEY (CCASE_NO);

/gustav


>>> gjgiever at myway.com 03-11-2006 15:12:25 >>>

I'm setting up a program that must make a copy of a table (dbo_CLIENTMAST)in a different application then make one of the fields in the new table a primary key.  Making the copy is easy but changing the field to a primary key is causing me some problems.  I've tried various SQL statements but none have worked.  This is my last attempt and it seems like it should work but I get the message "Syntax error in CONSTRAINT clause."  tblClientMaster is the new table.

ALTER TABLE tblClientMaster ADD CONSTRAINT UNIQUE (CCASE_NO);

Any help would be much appreciated.


Gary J. Giever, M.A.
Applications Developer
ACCMHS




More information about the AccessD mailing list