用友软件从上年结转并建立新数据库,在传送基础数据(invoiceitem_sal这张表)时出现错误,用DBCC checkdb() 出现以下两错误:
Msg 2535,level 16,state 1,line 0
Table corrupt:page(1:2977) is allocated to object ID 1620916846, index ID 3,not to object ID 0 found in page header.Msg 8909,level 16,state 1,line 0
Msg 2535,level 16,state 1,line 0
Table corrupt:page(1:2977) is allocated to object ID 1620916846, index ID 3,not to object ID 0 found in page header.Msg 8909,level 16,state 1,line 0
WHERE id = 1620916846 AND indid = 3把这个索引重建一下,应该就OK了!
Good luck!
USE MASTER
GO
sp_dboption '你的数据库名', 'single user', 'true'
Go
DBCC CHECKDB('你的数据库名', REPAIR_REBUILD)
Go
USE 你的数据库名
go
exec sp_msforeachtable 'DBCC CHECKTABLE(''?'',REPAIR_REBUILD)'
exec sp_msforeachtable 'DBCC DBREINDEX(''?'')'
go
sp_dboption '你的数据库名', 'single user', 'false'
Go