Solution to errors when SQL Server 2008 attaches a database

Source: Internet
Author: User
Tags microsoft sql server

Will soon start to do the computer room fee system, want to understand the function of the system must first understand the predecessors of the database. After getting the original database Charge_sys.mdf and charge_sys.ldf, you can't wait to attach to SQL Server.

However, the problem is that when attaching the database primary data file Charge_sys.mdf, "An error occurred while attaching the database out." For more information, click the error in the hyperlink in the message column. The following figure:

Click the hyperlink in the "message" to indicate the error:

Check the Internet, this error (Error 5120), most likely because of the permissions problem, that our current account does not have sufficient permissions to attach this database. So here are two ways to solve this problem easily:

1. Copy the files that will be attached to the SQL Server default data directory (C:\Program Files\Microsoft SQL Server\mssql10. Mssqlserver\mssql\data\), it will succeed if you attach it again.

2. When landing SQL Server, select "Windows Authentication" to log in.

But it's not too early to be happy here, because some versions of SQL Server may also have the following error:

See more highlights of this column: http://www.bianceng.cn

The error indicates that the database version is 661 and cannot be opened. This server supports version 655 and lower and does not support degraded paths.

This situation is due to the high version of the database file on the lower version of the database, that we are attaching a version of the database file is higher than the current version of SQL Server, which is equivalent to the Word2010 document with Word2003 Open when the reason is not compatible. And now there are two more realistic ways I know:

1. Install a higher version of SQL server:2000 up to 2005 or higher, 2005 liters to 2008 or 2008 r2,2008 to 2008 R2;

2, the type is on other computers with a higher version of SQL Server attached, and then export script.

Relatively speaking, it is more convenient to generate scripts, so the first method can be ignored, nonsense not much said, the following methods:

Open a newer version of SQL Server (here, for example, SQL Server 2008 R2), right-click the database to generate the script:

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: 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.