Skip to content Skip to sidebar Skip to footer

What Happens When I Drop A Clustered Primary Key In Sql 2005

I've a PK constraint - a clustered index on two columns - which I am in the process of dropping. The command is still running after an hour. I would have thought that as I am just

Solution 1:

Clustered index is not "just a constraint", it's a storage method.

When you drop it, your data are being reordered from clustered storage to heap storage

Other indexes are being updated to refer to RID's instead of PRIMARY KEY values.

Solution 2:

The clustered index is the data, that would explain the time it is taking to run.

Solution 3:

A "CLUSTERED" index will physically write the records of your table in order on the hard drive. So dropping or changing that index would likely cause SQL Server to basically 'defrag' (reorder) your hard drive (well, at least the part where the data for that table is).

Please note, this answer is not perfectly technical... but it's meant to give you the "oh, that's kinda what's happening" answer which is usually way more than good enough.

Post a Comment for "What Happens When I Drop A Clustered Primary Key In Sql 2005"