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
 New to SQL Server Programming
 Dropping Indexes and recreating the same

Author  Topic 

JananiK
Starting Member

2 Posts

Posted - 2008-05-01 : 08:08:28
I would like to know if there is a way to drop/ disenable all the indexes in a maintenance plan?
Or is it better to write scripts for dropping indexes and recreatig the same?

Purpose: Need to drop indexes(not the Primary key) before loading data and recreate the same after loading

Looking forward for suggestions/Solutions!

Thanks,
Janani

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2008-05-01 : 08:23:09
well that depends on the structure of your data and the primary key.
will there be a lot of page splits after the insert?
why do you need to drop indexes before loading?

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
SSMS Add-in that does a few things: www.ssmstoolspack.com
Go to Top of Page

Lumbago
Norsk Yak Master

3271 Posts

Posted - 2008-05-02 : 04:06:21
If you're using 2005 you can disable indexes by issuing an ALTER INDEX ix_name ON table_name DISABLE but we aware that disabeling a clustered index will prevent user access from the table until the index is rebuilt again. Enabeling can be done by issuing an ALTER INDEX ix_name ON table_name REBUILD

--
Lumbago
Go to Top of Page
   

- Advertisement -