cool hit counter SQLServer 2008 error when attaching database_Intefrankly

SQLServer 2008 error when attaching database


Copyright: This is an original post by the blogger and may not be reproduced without the blogger's permission. https://blog.csdn.net/huyuyang6688/article/details/10079741

I'm about to start working on the server room charging system, and to understand the functionality of the system I need to understand the database of the predecessors. After getting the original databases charge_sys.mdf and charge_sys.ldf, couldn't wait to attach them to SQL Server.

But here's the thing., In attaching the database primary data filecharge_sys.mdf time, (after a verb) emerge“ Error when attaching database out。 For more information, Please click" information" Hyperlinks in columns” mistake。 as shown below:

After clicking on the hyperlink in the "Message", the error message says.

After checking online, this error (error 5120) is most likely due to a permission issue, i.e. we don't have enough permissions to attach this database with this current account. So here are a few ways to easily solve this problem.

1. Copy the file to be attached to the default Data directory of SQL Server (C:Program FilesMicrosoft SQL ServerMSSQL10.MSSQLSERVERMSSQLDATA), and the attachment will be successful again.

2、When logging in to SQL Server, select "Windows Authentication" to log in, and then attach the database will be successful.

3, right-click the database file to be attached, Properties → Security → Edit, in the "Combined User Name" list, select Authenticated Users, in the list of permissions below select "Full Control", OK. Re-attach the database will be successful (warm tip: mdf files and ldf files have to be set up this way! )

But it's not too early to rejoice here, as some versions of SQL Server may also have errors such as.

The error says "The database version is 661 and cannot be opened. This server supports version 655 and lower, and does not support downgrade paths."

This situation is caused by a high version of the database file on a low version of the database, that is, we want to attach the database file version is higher than the current SQL Server version, which is equivalent to Word2010 documents with Word2003 open incompatible is a reason. And as far as I know there are two more realistic methods.

1. Install higher versions of SQL Server: 2000 to 2005 or higher, 2005 to 2008 or 2008 R2, 2008 to 2008 R2.

2. kind of attach it on another computer with a higher version of SQL Server and then export the script.

In comparison it is easier to generate scripts, so the first method can be ignored, and without further ado, the method is as follows.

Open a higher version of SQL Server (here SQL Server 2008 R2 as an example) and right click on the database for which you need to generate a script:.

The profile page for the generated script appears.

Click Next and the Select Objects screen appears, select the objects according to your actual needs (here the value generation table is used as an example).

In the next step, select the location where you want to generate the script, noting the "Advanced" button in the red oval.

Since the reason for doing these tasks is that the version of SQL Server on your computer is too low, the most important thing is to select the "Script for server version" option as the lower version (here select "SQL Server 2008"), and select the others as needed, and make sure that

Next step.

Click "Finish" and you're done! Go ahead and import your generated script on a lower version of SQL Server! But don't forget to create a new empty database with the same name before importing the script (for example, this example requires a new database named "charge_sys").


Recommended>>
1、Clojurecomponent Design Philosophy
2、Myanmar Royal International Network Account 18287977767
3、Testing and breaking a new exploration of Internet home improvement has begun
4、How does natural language processing check for spelling errors Tensorflow example tutorial source code
5、Demystifying Tucson Why Nvidia invested in this unmanned car company theres an elder behind the 18 billion valuation

    已推荐到看一看 和朋友分享想法
    最多200字,当前共 发送

    已发送

    朋友将在看一看看到

    确定
    分享你的想法...
    取消

    分享想法到看一看

    确定
    最多200字,当前共

    发送中

    网络异常,请稍后重试

    微信扫一扫
    关注该公众号