CREATE FILE encountered operating system error 5(Access is denied.) while attempting to open or create the physical file
I recently installed SQL Server Data Tool CTP4, created my first Database project (a SSDT one), pressed F5 and got the following error:
Error: SQL72014: .Net SqlClient Data Provider: Msg 5123, Level 16, State 1, Line 1 CREATE FILE encountered operating system error 5(Access is denied.) while attempting to open or create the physical file 'X:\Documents\Visual Studio 2010\Projects\Database1\Database1\Sandbox\Database1_Primary.mdf'.
X:\Documents\Visual Studio 2010\Projects\Database1\Database1\bin\Debug\Database1.sql(39,1): Error: SQL72014: .Net SqlClient Data Provider: Msg 1802, Level 16, State 4, Line 1 CREATE DATABASE failed. Some file names listed could not be created. Check related errors.
I'm using Windows 7 with UAC turned off so I'm running Visual Studio as an administrator. I tried giving 'Everyone' or 'Network Service' full permission on the Sandbox directory, but all to no avail. What could this be?
I know it it an old threrad but I just got this.
I had moved a sql 2005 database from an XP developement machine to a win7 dev machine
I saw an other thread where the user should run sql server under administrator,
Instead I gave myself full permission on both the files
I hope this will be of use to someone