September 30, 2008 at 11:23 am
Hi all,
I need to disable an index from a table on certain condition from a stored procedure. How can i do this? Is it good to use DDL commands inside an stored procedure?
September 30, 2008 at 11:30 am
My first question is why do you need to disable the index?
😎
September 30, 2008 at 11:41 am
i'm updating one clustered index column. If i do with index it takes time to execute, if i do the same update without index its faster. so due to performance i want to disable index. is it good idea or any other way to do it?
September 30, 2008 at 11:49 am
Actually, that's one of the reasons they state in BOL for disabling an index. Go to books on line and check out ALTER INDEX.
😎
September 30, 2008 at 11:56 am
Hi,
I don't think you can disable the idnex.
instead you can drop and re create it.
If your table contains huge no of records with clustered index created
then re creating index will also slow.
September 30, 2008 at 12:01 pm
dfine (9/30/2008)
Hi,I don't think you can disable the idnex.
instead you can drop and re create it.
If your table contains huge no of records with clustered index created
then re creating index will also slow.
Actually, in SQL 2005 you can disable an index with ALTER INDEX. Check BOL example E. After disabling the index, to enable the index again, you have to use ALTER INDEX REBUILD or CREATE INDEX WITH DROP_EXISTING.
😎
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply