Created
March 28, 2013 09:10
-
-
Save davidfowl/5261815 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
begin transaction | |
go | |
alter table dbo.ChatMessages drop constraint PK_ChatMessages | |
go | |
create clustered index CX_ChatMessages_When on dbo.ChatMessages ([When]) | |
go | |
alter table dbo.ChatMessages add constraint PK_ChatMessages primary key nonclustered ([Key]) | |
go | |
commit transaction | |
go |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As you can only have one clustered index on a table, yes, you must drop the PK first and recreate it as a non-clustered PK.