Welcome Guest, you are in: Login

MUST Creative Engineering Laboratory

RSS RSS

Navigation



Technical Doc



Search the wiki
»

MUST Corp.

MUST Corp.

www.must.or.kr

 Microsoft CERTIFIED Partner Software Development, Web Development, Data Platform

 Microsoft Small Business Specialist

MCSD

Microsoft Certified IT Professional

Microsoft Certified Professional Developer

Page History: Reducing SQL Server Index Fragmentation

Compare Page Revisions



« Older Revision - Back to Page History - Newer Revision »


Page Revision: 2010/06/24 00:33


DECLARE @TableName sysname DECLARE cur_showfragmentation CURSOR FOR SELECT table_name FROM information_schema.tables WHERE table_type = 'base table' OPEN cur_showfragmentation FETCH NEXT FROM cur_showfragmentation INTO @TableName WHILE @@FETCH_STATUS = 0 BEGIN SELECT 'Show fragmentation for the ' + @TableName + ' table' SET @TableName = '' + @TableName + '' DBCC SHOWCONTIG (@TableName) FETCH NEXT FROM cur_showfragmentation INTO @TableName END CLOSE cur_showfragmentation DEALLOCATE cur_showfragmentation

MUST Creative Engineering Laboratory

ImageImage Image Image

Image Image Image Image Image Image Image

Copyright © 2010 MUST Corp. All rights reserved. must@must.or.kr
This Program is released under the GNU General Public License v2. View the GNU General Public License v2 or visit the GNU website.