Back up the database first, and then use the following method:
Copy codeThe Code is as follows: USE MASTER
GO
SP_CONFIGURE 'Allow updates', 1 RECONFIGURE WITH OVERRIDE
GO
Alter database Database_Name SET EMERGENCY
GO
Sp_dboption 'database _ name', 'single user', 'true'
GO
Dbcc checkdb ('database _ name', 'repair _ ALLOW_DATA_LOSS ')
GO
Alter database Database_Name SET ONLINE
GO
Sp_configure 'Allow updates', 0 reconfigure with override
GO
Sp_dboption 'database _ name', 'single user', 'false'
GO
Create a new database with the same name, stop the SQL server service, overwrite the new database file with the data file of the original database, and restart the SQL server service. Open the Enterprise Manager, and the database displays "Suspect". Execute the preceding statement in the query analyzer. If the database itself is still faulty after execution, "Doubt" is still displayed ". Create a new database, run the DTS export wizard, and import the data in the problematic database to the new database. Open the new database and retrieve all the data!