DROP PRIMARY KEY

G

Guest

Hi there ... I want to DROP a PRIMARY KEY from an access table before I can
add a new one ... The code I have now is ...
ALTER TABLE info DROP PRIMARY KEY
but that doesn't seem to work ... Can anyone please help me with this?
 
J

John W. Vinson

Hi there ... I want to DROP a PRIMARY KEY from an access table before I can
add a new one ... The code I have now is ...
ALTER TABLE info DROP PRIMARY KEY
but that doesn't seem to work ... Can anyone please help me with this?

Try

ALTER TABLE info DROP INDEX PrimaryKey;

The index is just named PrimaryKey by default - there may be an index with a
primary key property that has a different name, but only if you did so
yourself.

John W. Vinson [MVP]
 
G

Guest

John W. Vinson said:
Try

ALTER TABLE info DROP INDEX PrimaryKey;

The index is just named PrimaryKey by default - there may be an index with a
primary key property that has a different name, but only if you did so
yourself.

John W. Vinson [MVP]

That didn't quite work, I got this error ... Error in ALTER TABLE statement
and the word INDEX was highlighted.

I then tried
DROP INDEX num ON info ... but then I get this message ... no such index
'num' on table 'info'

And then I just started playing around and this worked ...
DROP INDEX PrimaryKey ON info;

Thanx for everything
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top