By design it is not possible to change this behavior through SQL Server Management Studio (SSMS). There are documents from Microsoft (here and here) that “clearly” explain this behavior. While the articles are related to MSSQL 2008 is still true for MSSQL 2005/2012 (needs to verify for 2014): “File access permissions are set during a number of database operations, including detaching or attaching a database. For information about file permissions that are set whenever a database is detached and attached, see Securing Data and Log Files in SQL Server 2008 R2 Books Online.” second link from above.
One possible work around to resolve this situations is:
- Create a batch file to fix file permissions.
Using ICACLS you can execute something like this:
icacls c:\data\* /grant:r “OWNER RIGHTS”:FMRX
icacls c:\data\* /grant:r Administrators:FMRX
icacls c:\data\* /grant:r “NT SERVICE\MSSQLSERVER”:FMRX