SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
Search:  
 
 

Index Fragmentation

By Sergio Govoni, 2008/07/09

Total article views: 1857 | Views in the last 30 days: 45

To print commands ALTER INDEX ... REORGANIZE or REBUILD for the indices of database TestDB with avg_fragmentation_in_percent greater than 10 (%) is sufficient run:

EXEC USP_ExecReorgRebuildIndex 'TestDB', 0, -1, 10

To run the defragmenter, use instead:

EXEC USP_ExecReorgRebuildIndex 'TestDB', -1, 0, 10

By Sergio Govoni, 2008/07/09

Total article views: 1857 | Views in the last 30 days: 45
Your response
 
 
Related tags
 
Related content

What does this return?

By | Category: T-SQL
(not yet rated) | 3,857 reads

Statistics

By Site Owners | Category: SQL Server 2005
(not yet rated) | 3,218 reads

Datetime conversion

By Kev Riley | Category: SQL Server 2005
(not yet rated) | 4,010 reads
 
Contribute
Like this? Try these...

Checking fragmented indexes

By Gaby Abed | Category: index
(not yet rated) | 422 reads

Free registration required...

To read the rest of this article, and access thousands of other articles, we ask you to register on the site and subscribe to our newsletters.

Login (existing users)

Login

Email:   Password:   Remember me: Forgotten your password?

Register (new users)

Register

Email:   Password:
Confirm:

Subscribing to our newsletters gets you:

  • ALL of our content (thousands of articles, scripts, and forum postings)
  • A daily newsletter (example)
  • A weekly news round up (example)
  • The opportunity to ask and answer questions in our forums
  • A daily Question of the Day to test and help you increase your knowledge of SQL Server.

Steve Jones
Editor, SQLServerCentral.com