By default, when you create a primary key column in SQL Server, it makes it a clustered index. Sometimes this will be a default advantage, sometimes a serious disadvantage for performance as clustered indexes are the cornerstone of performance tuning in SQL Server. In the event that a clustered primary key gets created and you need to change it to a non-clustered one, follow these steps:
- Open the table in design view in SQL Server Management Studio (right click on the table in the object explorer, click 'Modify')
- Right Click anywhere over the column definitions, from the context menu click 'Indexes/Keys'
- Select your primary keys index by name in the right listbox
- In the right pane, under the section titled 'Table Designer' find the item labeled 'Create as Clustered' and change the 'Yes' to 'No'.
- Click close, then close the design view of the table, and choose the option to save.
- If you have full text catalogs on this table you may need to repopulate them.
That should be it, now you are able to create a clustered index on another column or set of columns on your table.
Posted
Jan 18 2009, 09:25 PM
by
dacrowlah