How to convert a clustered primary key to nonclustered without dropping foreign key references in SQL Server 2005

I made a mistake creating a clustered primary key in a GUID column. There are many tables that reference this table with specific foreign keys. The table size is small.

I would like to convert it from clustered to nonclustered without manually deleting and re-creating any foreign keys or even primary key constraints.

Is it possible to achieve this in MS SQL2005 and how, if so?

Is it possible to achieve this ONLINE (without db down time), if so?

+5
source share
1 answer

NC, . FK ( : ).

ALTER TABLE, , ONLINE. Enterprise.

ALTER TABLE Mytable DROP CONSTRAINT PK_Mytable WITH (ONLINE = ON)

ONLINE ADD CONSTRAINT.

, ...

+3

All Articles