Repeat the data center and refer to the previous physical model. As a result, some problems have occurred while attaching the database. The following is a summary.
1. Failed to append the database. Error 5120
For this error, I collected it online and found the following solutions:
Method 1: copy the file to be appended to the default Data directory of SQL Server, that is, C: \ ProgramFiles \ Microsoft SQL Server \ MSSQL11.MSSQLSERVER \ MSSQL \ DATA.
Method 2: during login verification, select "Windows Authentication" instead of "SQL Server Authentication ".
Method 3: Change the MDF and LDF files to full control.
Method 4: If you must use "SQL Server Authentication", change the Account Logon permissions so that they have full operation permissions on the files to be attached, change the Account Logon identity of SQL Server to "Network Service" to "Local Service.
This is the third case.
2. Failed to append the database. Error 950
I have struggled with this error for a long time. I checked it online and found a solution. Finally, I asked an experienced student to solve it. The version of the additional database is SQL Server2005, and I am using SQL Server2012. SQL Server2012 is compatible with SQL Server2008 but not SQL Server2005.
Solution: append the SQL Server2005 database with SQL Server2008 and re-generate the script so that SQL Server2012 can be attached.