SQL Server database attached error summary analysis

Source: Internet
Author: User
Tags microsoft sql server

Error 5123 prompted when attaching a database to sql2008

Unable to retrieve data for this request ...... An exception occurred when executing a Transact-SQL statement or batch processing ...... When you try to open or create a physical file d: dataejiaOA. mdf, createfile encounters a system error 5 (access denied ). (Microsoft SQL Server, error: 5123 ).


Solution


1. Directly copy your database to the SQL installation directory C:/pg/msql/MSSQL10.MSSQLSERVER/mssql/DATA


2. on the mdf and ldf files of your database, right-click ----> properties ----> add ----> advanced ----> search now ----> Authenticated Users ----> OK ---> check with full control ----> OK

If the problem persists, try again.

Right-click the elastic block storage, and view the permissions of the user on the "security" tab in properties. Check who the startup account is, run services. msc, find the SQL Server service in the service manager, view the "logon" tab, select a local user, and restart the service.


Microsoft SQL Server, error: 3415


An error occurred while attaching the database to the server "servername. (Microsoft. SqlServer. Smo)

The database 'dbname' cannot be upgraded because it is read-only or has a read-only file. Set the database or file to writable, and then run the recovery operation again. (Microsoft SQL Server, error: 3415)


After checking the database files, they do not have the read-only attribute. Attaching the database files to SQL Server 2000 is normal. Click the help link in the error message dialog box to open an invalid link of I'm sorry. BS: Microsoft.

Multiple Research parties found that the file is not read-only. Strictly speaking, it should be a "permission" problem. The current SQL Server login account does not have the write permission for the file to be attached, the above "read-only" prompt appears. The solutions are as follows:

• Copy the file to be appended to the default Data directory of SQL Server. The attachment will succeed;
• During login verification, select "Windows Authentication" instead of "SQL Server Authentication", even if your login account is sa;
• If "SQL Server Authentication" is required, change the logon account's permissions so that it has full operation permissions on the files to be attached;
• Change the Account logon identity of SQL Server from Network Service to Local Service;
This problem occurs in Windows XP. By the way, the current SQL Server 2008 Enterprise Edition can be installed in XP.


SQL2008 append Database Error Code 5120


Cause of error: This file has no operation permission, so an error occurs when it is attached. You only need to grant full access to the USERS of this file or folder.
 

Solution:

1. Right-click the database file icon and choose "properties"> "security"> "edit.

2. Select Authenticated Users from the group or user name list, and select full control from the permission list.

3. Select "OK" to close the dialog box.

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.