none
CREATE FILE encountered operating system error 5(Access is denied.) while attempting to open or create the physical file

    Question

  • 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?

    Friday, December 02, 2011 9:07 PM

Answers

All replies

  • Are you creating the project on a fileshare, in other words is X: a mapped network drive?

     


    -GertD @ www.sqlproj.com
    Wednesday, December 07, 2011 10:47 PM
    Moderator
  • We can't reproduce this behavior as written, but we'd be happy to reopen investigation if more detail is provided.

    Thanks,

    Janet Yeilding

    Tuesday, June 26, 2012 5:57 PM
    Owner
  • 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


    jnc

    Tuesday, October 29, 2013 9:09 AM