Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Changing Primary Key

Author  Topic 

tincupal
Starting Member

24 Posts

Posted - 2007-10-19 : 11:51:33
SQL 2000 Enterprise Manager won’t let me drop a unique key index and move it to another field. I get an error regarding "drop index not allowed because of unique key constraint enforcement".

Is there anyway to change the primary key from field1 to field2 in SQL Enterprise Manager?

Thanks, Al

nr
SQLTeam MVY

12543 Posts

Posted - 2007-10-19 : 11:59:51
alter table mytbl drop constraint myconstraint
alter table mytbl add constraint myconstraint primary key (cols)


==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

tincupal
Starting Member

24 Posts

Posted - 2007-10-19 : 13:20:16
That worked thanks very much. Boy, am I glad I found this site.
Go to Top of Page
   

- Advertisement -