locked
Unable to create database in particualr folder RRS feed

  • Question

  • Hi,

    When i am trying to create a database in Sql Server in my PC, i am not allowed to create database in a particular folder. It gives an error saying that,

    Msg 1802, Level 16, State 4, Line 1

    CREATE DATABASE failed. Some file names listed could not be created. Check related errors.

    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 'C:\Program Files\Test\Database\CheckCreation.mdf'.

    I am having the administrator access in that PC but still not allowed.


    I am able to create it in all other folders.

    Can anyone help me in this issue?

    Thanks & Regards,
    Subalakshmi Vijayarajan.

    Friday, November 20, 2009 11:32 AM

Answers

  • Hi Subalakshmi

    The SQL Server Service account must have Full Control permissions in the folder that you're using

    C:\Program Files\Test\Database\

    It's not your permissions that are used to perform this action

    HTH

    Ewan

    If you have found this post helpful, please click the 'Vote as Helpful' link (the green triangle and number on the top-left).

    If this post answers your question, click the 'Mark As Answered' link below. It helps others who experience the same issue in future to find the solution.
    • Proposed as answer by phe Friday, November 20, 2009 2:19 PM
    • Marked as answer by Zongqing Li Thursday, November 26, 2009 7:23 AM
    Friday, November 20, 2009 1:58 PM

All replies

  • How do you connect to SQL Server ? Using windows authentication or Sql authentication ?   and whether the SQL Server(not the client) is runinng on your same PC ?
    Friday, November 20, 2009 11:38 AM
  • I am using windows authentication .... My server is running on my local PC.... I am able to create database in all other folders except that particular path :(
    Friday, November 20, 2009 11:41 AM
  • Can you mannually create files in that particular folder? If yes, check SQL Server service account is runnig using the same credentials.
    Friday, November 20, 2009 11:51 AM
  • Yeah I am able to create files manually in that folder and further I am able to create database in other folders. Hence sql service is also running ...
    Friday, November 20, 2009 12:04 PM
  • Hi Subalakshmi

    The SQL Server Service account must have Full Control permissions in the folder that you're using

    C:\Program Files\Test\Database\

    It's not your permissions that are used to perform this action

    HTH

    Ewan

    If you have found this post helpful, please click the 'Vote as Helpful' link (the green triangle and number on the top-left).

    If this post answers your question, click the 'Mark As Answered' link below. It helps others who experience the same issue in future to find the solution.
    • Proposed as answer by phe Friday, November 20, 2009 2:19 PM
    • Marked as answer by Zongqing Li Thursday, November 26, 2009 7:23 AM
    Friday, November 20, 2009 1:58 PM
  • Create one folder for sample  and provide this folder path to .ldf and .mdf file

    it will work

     

     

     

    Wednesday, October 20, 2010 11:09 PM