July 31, 2012 at 5:57 am
Hi
I'm struggling to drop a primary key.
I get the error:
An explicit DROP INDEX is not allowed on index 'MyTable.PrimaryKey'. It is being used for FOREIGN KEY constraint enforcement.
"sp_helpindex MyTable", returns 1 entry:
PrimaryKey, nonclustered, unique located on PRIMARY, ID
I also tried:
alter table MyTable DROP CONSTRAINT PrimaryKey
I even went as far as dropping all primary keys and foreign keys on the entire database, but the error still pops up. Any ideas?
July 31, 2012 at 5:59 am
what results do you get when you run EXEC sp_fkeys myTable?
Lowell
July 31, 2012 at 8:38 am
OK - thanks. I found a couple of FK's, and I've removed it manually and it's working now.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply