SQL bit 7-errors and workarounds for attach features using SQL Server

Source: Internet
Author: User

Source: SQL Drip 7-error and workaround for attach function using SQL Server

Today, with the SQL Server 2008 Attach feature attached a database, a bit of a problem, the prompt error is:

Unable to open physical file "D:\Documents\Dalt\XXXX.mdf" Operating system error 5: ' 5 (Error not found) ' (Microsoft SQL Se Rver:error 5120) ".

Remember to do similar operations did not have any problems, do not know why this, there is no way to find a solution on the internet,

Http://social.msdn.microsoft.com/Forums/en/sqldatabaseengine/thread/9e563890-e35f-4524-82b9-3cca08fec5ed

MSDN Forum says you need to add a user right to the. mdf,.ldf file, run the following statement to find the name of the permission

1 Declare @sqlser varchar( -)
2 EXECMaster.. Xp_regread@rootkey='HKEY_LOCAL_MACHINE', @key='System\currentcontrolset\services\mssqlserver',
3 @value_name='objectname', @value=@sqlserOUTPUT
4 PRINT 'Account starting SQL Server Service:' +Convert(varchar( -),@sqlser)

The result on my machine is: Account starting SQL Server Service:localsystem, then right-click the folder containing the. mdf,.ldf file, switch to the security interface, add LocalSystem user. I can never find this user here, as

But here are some users such as: User (Prchaz01210\user), Administrator (Prchaz01210\user), I gave the latter to add Full Control permissions, and then try to attach, did not expect to succeed, I do not know the above statement to find out what information, and so there is time to see.

SQL bit 7-errors and workarounds for attach features using SQL Server

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.