ms-sql全庫索引重建腳本

use database_name
go
DECLARE @name varchar(100)
DECLARE authors_cursor CURSOR FOR  Select [name]   from sysobjects where xtype='u' order by id
OPEN authors_cursor
FETCH NEXT FROM authors_cursor  INTO @name
WHILE @@FETCH_STATUS = 0 BEGIN    
DBCC DBREINDEX (@name, '', 90)
FETCH NEXT FROM authors_cursor     INTO @name END
deallocate authors_cursor
go

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章