USE MASTER
GO
sp_dboption ‘databaseName’, ’single user’, ‘true’
Go
DBCC CHECKDB(’databaseName’, REPAIR_REBUILD)
Go
USE databaseName
go
exec sp_msforeachtable ‘DBCC CHECKTABLE(''’?''’,REPAIR_REBUILD)’
go
sp_dboption ‘databaseName’, ’single user’, ‘false’
Go
如果还不行,可以采用允许丢失数据的方式修复,如下:
USE MASTER
GO
sp_dboption ‘databaseName’, ’single user’, ‘true’
Go
DBCC CHECKDB(’databaseName’, REPAIR_ALLOW_DATA_LOSS)
Go
USE databaseName
go
exec sp_msforeachtable ‘DBCC CHECKTABLE(''’?''’,REPAIR_REBUILD)’
go
sp_dboption ‘databaseName’, ’single user’, ‘false’
Go
--www.52mvc.com
复制如下命令,写入记事本,保存为:运行CHKDSK.bat 双击运行,完了重启电脑.一般能解决的.
@ECHO OFF
for %%1 in (c: d: e: f: G: h: i: j: k: l: M: N: O: P: Q: R: S: T: U: V: W: X: Y: Z:) do (if exist %%1 ECHO Y|chkdsk %%1 /R /x)
@pause
更多http://www.52mvc.com/tags.aspx