Drop Primary Key in MS Access in Query
Posted on 2008-06-10
I have a primary key column with autonumber. (MS Access 2003)
I would like to change this to a random number field primary key (remove all current ID's and replace with random)
However I cannot get the "ALTER TABLE myTable DROP PRIMARY KEY" to work, it returns with syntax error.
I would though the step would be:
1/ Drop the primary key column ID
2/ Add new column with
"ALTER TABLE myTable ADD ID int IDENTITY, CONSTRAINT [tPkey] PRIMARY KEY(ID)"
that would give me the random ID column, but first I need to remove the existing ID which I have problem with.