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
 drop and re-create index

Author  Topic 

rudba
Constraint Violating Yak Guru

415 Posts

Posted - 2009-07-16 : 17:21:51
I have fews index on each tables.
How do i drop these index and create same name keys index.

I can see the list of indexes on a table :
EXEC sp_helpindex 'table name'

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-07-16 : 17:31:25
You can use DROP/CREATE INDEX. Depending upon what you are doing, you could just ALTER INDEX.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page

rudba
Constraint Violating Yak Guru

415 Posts

Posted - 2009-07-16 : 17:42:12
i have huge data so i want to reindex first using (DBCC DBREINDEX) than i want to drop all the indexes and create same index........and will do shrinkfile.....so i can reduce my db size.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-07-16 : 18:33:45
It doesn't make sense to run the reindex and then to drop/create.

What version of SQL Server are you using?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page

rudba
Constraint Violating Yak Guru

415 Posts

Posted - 2009-07-16 : 20:59:43
We have sql server 2005.
Now I have few free specases. When I shrink file, it makes free spaces but when I reindin it will deragment and db size will increase more than actual size.
Guys anybody have ideay to reduce our db size?

Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2009-07-17 : 00:18:15
you can add another filegroup and create the indexes on that.

BUT

the data files are the size they are becuase of the amount of data/indexes you have. seems you may need more disk space
Go to Top of Page
   

- Advertisement -