渔鱼

人生豪迈,在此一博!

  博客园 :: 首页 :: 博问 :: 闪存 :: :: 联系 :: 订阅 订阅 :: 管理 ::

USE My_Database;
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

posted on 2009-05-19 08:23  博闻李  阅读(3630)  评论(0编辑  收藏  举报