步骤1:停止SQL服剞脑惨丁务管理器,将原数据文件拷贝,使用思迅数据库安装程序创建一个新的数据库。步骤2:停止SQL Server步骤3:把老数据库的MDF文件替换新剞麽苍足数据库的相应的MDF文件,并把LDF文件删除。步骤4:重新启动SQL Server服务,然后运行如下命令:Use MasterGosp_configure 'allow updates', 1reconfigure with overrideGobegin tranupdate sysdatabases set status = 32768 where name = 'hbposv7'--Verify one row is updated before committingcommit tran步骤5:停止SQL然后重新启动SQL Server服务,然后运行如下命令:DBCC TRACEON(3604)DBCC REBUILD_LOG('db_name','C:\Program Files\Microsoft SQL Server\MSSQL\Data\hbposv7_log.ldf')Go步骤6:停止SQL然后重新启动SQL Server服务,然后运行:use masterupdate sysdatabases set status = 8 where name = 'hbposv7'Gosp_configure 'allow updates', 0reconfigure with overrideGo步骤7:运行dbcc checkdb(hbposv7) 检查数据库的完整性注:都要替换成真实的数据库名字。