How can I DROP the PrimaryKey?

CabbageCake

New member
Local time
Today, 17:53
Joined
Dec 29, 2011
Messages
3
Welcome Everyone,
I am new on this forum, and I am looking forward to learn some tricks related to SQL via MS Access.

I have a following table:
Code:
create table Company
(Id numeric primary key,
FirstName varchar(50),
LastName varchar(50)
)

And now, I would like to drop my Id column with the following instruction:

Code:
alter table company 
drop column id

But I can not delete that column, because Access is referenced to the indexes and constraints (I suppose, it has a PrimaryKey).
How can I drop these indexes from the table?

I've found an expression for drop index on the internet:

DROP INDEX index_name ON table_name

But I don't know the index_name
How can I retrieve that name? Where it is stored in the program?

Any help would be greatly appreciated!
Thanks.
 
Right-click on the table and select "Design View". In the Design tab (Access 2007 and later) click on Indexes. A window should pop up showing the info for all indexes. The first column in the window is the index name. It looks like the default value is "PrimaryKey".
 
Very Thaks your suggestion.
I tried out with Access 2007, and it works fine.
 

Users who are viewing this thread

Back
Top Bottom