SQL Server database suspect solution _mssql

Source: Internet
Author: User
Back up the database, and then use the following method:
Copy Code code 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

Start by creating a new database with the same name, then stopping the SQL Server service, overwriting the new database file with the original database data file, and restarting the SQL Server service. Open Enterprise Manager, which displays "suspect" and executes the above statement in Query Analyzer. If the database itself is still problematic after execution, it still shows "doubt". Now create a new database, run the DTS Export Wizard, import the data from the problematic database into the new database, open the new database, and retrieve all the data!
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.