Error loading diagram
Workaround:
1. Copy your own database directly to the SQL installation directory C:/Program Files/microsoft SQL Server/mssql10. Mssqlserver/mssql/data
This can be attached, do not know is not in the installation of the database what the operation was omitted, has not been encountered before.
2. On the own database MDF and LDF files,
Right-----> Properties----> Add----> Advanced----> Find now---->authenticated Users----> OK
------> Full Control hook----> OK
Both of these methods can be, there may be other ways, the students themselves find it again ....
The day before yesterday to redo the system, reloading the sqlserver2012express, today, attach an original database when the error, the message is: Unable to retrieve data for this request ... Exception occurred while executing Transact-SQL statement or batch ... When attempting to open or create a physical file ' D:\data\ejiaOA.mdf ', CreateFile encountered system error 5 (Access denied). (Microsoft SQL Server, error: 5123).
See this broken hint, the first feeling is that the permissions of the folder does not appear to be in place (my system is 64 full Win7), in the old way: "File-> properties-> Security-> Add-> Advanced-> Find Now->everyone-> determine -> determine-> Full Control-> Application "is to this folder added permissions, another operation, or not!!" Suddenly depressed, I have a go ah, what situation? Baidu for a half-day, found some solutions, this is a bad way to change the permissions, which has a netizen said: Win7 is a very magical dongdong, have time folder operation permissions will not be inside the file inherited, so need to check the file itself is not also in line with the requirements of the operation. I did what this guy said and found out that my WIN7 obviously didn't have this feature, and the permissions of the file and its Dad's folder are consistent.
The cause of the problem is always unable to find, really let me have a headache for a long time, but for me this has a tough personality, I have not been scared, continue Baidu Baidu ... Finally, when I was about to despair, I found an article with screenshots as follows:
This file describes the problem and mine is exactly the same, but the solution is the same as my operation method, followed by comments, we also screenshot
It's not like I'm the unlucky one, but I still find a problem with Windows authentication, what if you don't use Windows authentication? Exit SQL2012 Manager, with SA login again, and then perform this additional operation, incredibly a success!
The problem has finally been solved, but I also wondered, why is this? After checking, the original permissions of my database file are as follows:
I have reason to believe that this is the normal permissions of a database file, plus everyone's permissions control that is not normal. At the same time Mssql$sqlexpress is left to the sa login SQL Server Management permission to use, I am a hyper-managed account login system, obviously belong to the Super Tube user group, but why the attached database error? A friend who knows, please tell me, I appreciate it.!!!
Baidu has a netizen to explain this: this is because SQL Server's startup account (usually system or an operating system administrator), to E (my is D disk) Packing directory does not have the right to create files. Right-click E disk and view the Security tab in the properties to view the user's permissions. To see who the startup account is, run services.msc, locate the SQL Server service in the Service Manager, and then look at the Login tab to select the local user and restart the service.