SQL Server 2008 R2 attached database error

Source: Internet
Author: User
Tags microsoft sql server mssql file permissions

Because this database is not known that the version was created, in the official looked at, explained that the permissions are not right, should put this database in the directory of SQL Server installation, that is, C:\Program Files\Microsoft SQL Server\mssql.1\ Mssql\data, sure enough to solve the problem, but can not always put the database in this directory Ah! So I looked for other solutions;

The first solution: just the method, put this file in the SQL Server default location, but it is best not to put in the C disk, in the event of reloading the system that day, the play is over, haha;

The second solution is to change the default database folder for the SQL Server Real column, select the SQL Server instance, right-click the property, have a "database setting" on the left, and click on the "database default location", and set this to your own directory.

The third solution is to change the permissions of the folder where the database is located, add a user of everyone, set to "Full Control", it is OK, this program is direct and convenient;

Fourth: Click the way to modify your SQL MDF and LDF properties on it, select your file (two files must be modified to the same permissions)

MDF files: File Right >> properties >> Security >> Edit >> Add >> Advanced >> Find Now >> in search results select: Authenticated Users >> Confirm >> Confirm >> determine >>mdf file Properties dialog >> Select in Group or user Name list box: Authenticated users>> advanced >> Change Permissions >> edit >> Select "Security Control" >> OK >> confirm >> confirm >> OK. Ok this is the MDF permissions on the assignment complete!

LDF file permissions and MDF file permissions control, just follow the steps above the line!

If there are other additional errors, should also be the issue of permissions, as long as the right to modify the file on the line, try it on the finished ok!

See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/database/SQLServer/

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.