What happens when I drop a clustered primary key in SQL 2005

后端 未结 3 937
有刺的猬
有刺的猬 2021-01-19 14:50

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

3条回答
  •  无人共我
    2021-01-19 15:25

    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.

提交回复
热议问题