DROP AND CREATE PRIMARY KEY

A

Anwar

Hi,
I am trying to drop and add primary key of table

I tried both of following statementd, none of the
following worked,

ALTER TABLE TableName DROP PRIMARY KEY(PrimaryKeyIndexName)
ALTER TABLE TableName DROP PRIMARY KEY

Your help will be very appriciated

Thanks
 
T

Tim Ferguson

ALTER TABLE TableName DROP PRIMARY KEY(PrimaryKeyIndexName)

The primary key is a form of contraint; you'll have to find out what it's
called if you didn't write the original create table command. I think
Access usually uses either "[Primary Key]" or "PrimaryKey", but you'd need
to look in the Indexes collection.

alter table tablename drop constraint WhatEverYouCalledThePKConstraint;

Hope that helps


Tim F
 

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