Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 Database Design and Application Architecture
 Move clustered index to other column

Author  Topic 

ssnaik84
Starting Member

15 Posts

Posted - 2009-03-18 : 04:02:18
Hi,

I have one table with auto-increment (IDENTITY) column as primary key (PK). AFAIN, clustered index is automatically built on PK column.
Now, is it possible to move the clustered index to other column of the table? (Say, a column which stores person_name)

Thanks.

heavymind
Posting Yak Master

115 Posts

Posted - 2009-03-18 : 04:17:08
yes. you need to drop existing PK (if it is clustered) then create clustered index on the needed column and then create PK on the ID column using keyword nonclustered. You will probably need to drop foreign keys that refer to this table

Thanks, Vadym
MCITP DBA 2005/2008
Chief DBA at http://www.db-staff.com
Go to Top of Page
   

- Advertisement -