If I drop my clustered PK and add a new one, what order will my rows be in?
Posted
by stack
on Server Fault
See other posts from Server Fault
or by stack
Published on 2010-06-03T16:28:36Z
Indexed on
2010/06/03
16:34 UTC
Read the original article
Hit count: 195
sql-server
|indexes
In SQL Server, I'm looking at TableA, which currently has a uniqueidentifier clustered primary key. The GUID has no meaning in any context.
(I'll give you a second to clean up your keyboard and monitor and set down the soda.)
I'd like to drop that primary key and add a new unique integer primary key to the table. My question is this: when I drop the index, modify the column from uniqueidentifier to int, and add the new clustered unique primary key to the modified column, will the new PK values be in the order of insertion into the table, or will they be in some other order? Is this the right way to go here? Will this work? (I'm kind of a noobkin with regard to table creation/modification.)
© Server Fault or respective owner