MSSQL2005 data attaching failure error 3456 solution

Source: Internet
Author: User
Tags microsoft sql server

Solution:

1. Create a database with the same name (the data file must be consistent with the original one)
   
2. Stop SQL server again (do not detach the database)
   
3. Overwrite the new database with the data file of the original database.
   
4. Restart SQL server.
   
5. When you open the Enterprise Manager, there will be a doubt. Ignore it and execute the following statement (note that you must modify the database name)
   
6. after completion, you can generally access the data in the database. In this case, the database itself is still problematic. The solution is to create a new database using the database script, and export the data.
    
    
   

The code is as follows: Copy code


USE MASTER
GO

SP_CONFIGURE 'allow updates', 1 RECONFIGURE WITH OVERRIDE
GO

Update sysdatabases set status = 32768 where name = 'suspicious database name'
Go

Sp_dboption 'questionable database name', 'single user', 'True'
Go

Dbcc checkdb ('questionable database name ')
Go
   
Update sysdatabases set status = 28 where name = 'questionable database name'
Go

Sp_configure 'allow updates', 0 reconfigure with override
Go
   
Sp_dboption 'questionable database name', 'single user', 'false'
Go


The following error message is displayed after the preceding statement is executed:

The configuration option 'allowupdates' has been changed from 0 to 1. Run the RECONFIGURE statement for installation.

(The number of affected rows is 1)

Server: message 5105, level 16, status 4, row 1
Device activation error. The physical file name 'E: \ Program Files \ Microsoft SQL Server \ MSSQL \ data \ bserp_Data.MDF 'may be incorrect.
Sp_dboption command failed.
Server: message 8966, level 16, status 1, row 1
Failed to read and latch the page (97: 6553715) (using the latch type SH ). Sysobjects failed.
DBCC execution is complete. If DBCC outputs an error message, contact the system administrator.

(The number of affected rows is 1)

The configuration option 'allowupdates' has been changed from 1 to 0. Run the RECONFIGURE statement to install

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.