重建索引


USE MASTER
GO

sp_dboption 'AZDATA_001_2005','single user','true'

GO

DBCC CHECKDB('AZDATA_001_2005',REPAIR_REBUILD)  

GO

USE AZDATA_001_2005

GO

exec sp_msforeachtable 'DBCC CHECKTABLE(''?'',REPAIR_REBUILD)'
exec sp_msforeachtable 'DBCC DBREINDEX(''?'')'

GO

sp_dboption   'AZDATA_001_2005',   'single user',   'false'

GO
posted @ 2006-08-30 11:16  azhai  阅读(250)  评论(0编辑  收藏  举报