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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 DB Alter index (except certain tables) - possible?

Author  Topic 

Gopher
Yak Posting Veteran

83 Posts

Posted - 2011-10-17 : 09:12:45
Hi All

I am trying to put together a query which will run an alter index cmd for all but a few tables.

The cmd I have on one is:

ALTER INDEX ALL ON dbo.CUsers REBUILD WITH (FILLFACTOR = 90, SORT_IN_TEMPDB = ON, STATISTICS_NORECOMPUTE = OFF);

Unfortunately I have to do about 30 tables individually, due to size and space issues. But the rest are ok, there is just 15,000 of them!!!

Can anyone help?

Cheers

Gopher

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-10-17 : 09:20:26
use INFORMATION_SCHEMA.TABLES metadata schema and generate script for tables requires. then put results to text option , copy and paste out result in a new window and execute

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -