Click here to hide categories Click here to show left categories

User: Home          welcome : Guest          Log In / Register here     




Create an index with Drop existing index on table

If you want to Create an cluster index on table then there should not be any index on that table. So first need to remove the old index and update the index. To do this we may write the below command to update the index by dropping the old one and creating the new.

CREATE
UNIQUE CLUSTERED INDEX i_IndexA 
ON
tbCompany(id) 
WITH 
(DROP_EXISTING = ON); 

- i_IndexA = name of the Index
- id= column name of the table
- Drop existing=on means that If any old index is existing on the table then it should be removed.

Share this article   |    Print    |    Article read by 4161 times
Author:
Rohit kakria
I am software developer, moderator of xpode.com
Related Articles:
Related Interview Questions: