Solutions to SQL Server database Problems

Source: Internet
Author: User

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!

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.