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

Error when creating primary key...

Status
Not open for further replies.

ddiamond

Programmer
Apr 22, 2005
918
US
I executed the following statement:
Code:
alter table cm_claim_master add constraint pk_cm_claim_master primary key (claim_number);
I got the following error:

The column "<name>" identified in a PRIMARY KEY clause or UNIQUE
clause is defined to allow null values.
How to I add a null constraint to the field claim_number without dropping and recreating the table?
 
So far everything I've found on google suggests that what I want to do cannot be done. The only way to alter a columns null / not null property is to drop the able and recreate it. Does anyone know if that is true?
 
ddiamond.

according to my course notes, which were at udb v8.1.

You cannot change a column from null to not null or vice versa.

You cannot drop columns

Therefore what your saying does indeed appear to be true.

Cheers
Greg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top