database attached is read only

后端 未结 12 1149
借酒劲吻你
借酒劲吻你 2020-12-08 19:03

I used the following the script to attach a database. But the database created is read only.
What modifications should I make in the script to make it read-write. Pl

12条回答
  •  半阙折子戏
    2020-12-08 19:46

    Giving the sql service account 'NT SERVICE\MSSQLSERVER' "Full Control" of the database files

    If you have access to the server files/folders you can try this solution that worked for me:

    SQL Server 2012 on Windows Server 2008 R2

    1. Right click the database (mdf/ldf) file or folder and select "Properties".
    2. Select "Security" tab and click the "Edit" button.
    3. Click the "Add" button.
    4. Enter the object name to select as 'NT SERVICE\MSSQLSERVER' and click "Check Names" button.
    5. Select the MSSQLSERVER (RDN) and click the "OK" button twice.
    6. Give this service account "Full control" to the file or folder.
    7. Back in SSMS, right click the database and select "Properties".
    8. Under "Options", scroll down to the "State" section and change "Database Read-Only" from "True" to "False".

提交回复
热议问题