DataBase Creation Error

  • I am getting following Error

    Msg 5105, Level 16, State 2, Server ServerName, Line 1
    A file activation error occurred. The physical file name '"D:\\Data\\EAMTEST_index.ndf"' may be incorrect. Diagnose and correct additional errors, and retry the operation.
    Msg 1802, Level 16, State 1, Server ServerName, Line 1
    CREATE DATABASE failed. Some file names listed could not be created. Check related errors.

  • Try to change this part - D:\\Data\\EAMTEST_index.ndf to D:\\Data\EAMTEST_index.ndf (you have one extra \).

    Adi

    --------------------------------------------------------------
    To know how to ask questions and increase the chances of getting asnwers:
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    For better answers on performance questions, click on the following...
    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

  • Hi 
    I tryed that but still it is not working.
    Thanks,
    Padmakumar

  • In that case, make sure that the specified path (D:\data) exists.  If it does exist check that there isn't another file there with the name EAMTEST_index.ndf.  Another thing that you can check is that the user that is used to run SQL Server's service has permissions to use that directory.

    Adi

    --------------------------------------------------------------
    To know how to ask questions and increase the chances of getting asnwers:
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    For better answers on performance questions, click on the following...
    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

  • Adi Cohn-120898 - Wednesday, February 1, 2017 7:14 AM

    Try to change this part - D:\\Data\\EAMTEST_index.ndf to D:\\Data\EAMTEST_index.ndf (you have one extra \).

    Adi

    There are two extra backslashes in the original, not just one. Try this:

    D:\Data\EAMTEST_index.ndf

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • Post your CREATE DATABASE statement, please.  If you're doing it through the GUI (which I don't advise), click on the Script button in the New Database window.

    John

  • Follwing is my script
    CREATE database $(hmsDbName)
    ON PRIMARY (NAME= $(hmsDataName),
      FILENAME= [$(hmsDataFQFileName)],
      SIZE = $(hmsDataSize),
      MAXSIZE = $(hmsDataMaxSize),
      FILEGROWTH = $(hmsDataGrowth)),
    FILEGROUP [$(eamFileGroupName)]
    ( NAME = [$(eamFileGroupName)],
    FILENAME =[$(eamFileGroupFQFileName)] ,
    SIZE = $(eamFileGroupSize),
      MAXSIZE = $(eamFileGroupMaxSize),
      FILEGROWTH = $(eamFileGroupGrowth)),
    FILEGROUP [$(hmsFileGroupName)]
      ( NAME = [$(hmsFileGroupName)],
      FILENAME = [$(hmsFileGroupFQFileName)],
      SIZE = $(hmsFileGroupSize),
      MAXSIZE = $(hmsFileGroupMaxSize),
      FILEGROWTH = $(hmsFileGroupGrowth))
    LOG ON (NAME = [$(hmsLogName)],
      FILENAME=[$(hmsLogFQFileName)],
      SIZE = $(hmsLogSize),
      MAXSIZE = $(hmsLogMaxSize),
      FILEGROWTH = $(hmsLogGrowth))
    GO

    following is the vaiable from parm file which is creating problem
    eamFileGroupFQFileName="D:\\Data\\EAMTEST_index.ndf"

  • Mmmm... not much good without the actual parameter values, I'm afraid!  But as Adi and Phil have suggested, try unduplicating those backslashes in your file path(s).

    John

  • For variable passed through the property file we need two slashes.

  • padmakumark26 - Wednesday, February 1, 2017 7:43 AM

    For variable passed through the property file we need two slashes.

    Presumably that's because one of them is an escape character?  Unfortunately, if you look at the error message, you see it's not being escaped.  How are you passing the command to SQL Server, and how did you generate that script that you posted?

    John

  • padmakumark26 - Wednesday, February 1, 2017 7:43 AM

    For variable passed through the property file we need two slashes.

    Then maybe you need to remove them in your script, before issuing the CREATE command.

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • Script is created by me. As you see in the Script I have 3 Data files and one Log file .If i remove this particular file (NDF) all works fine.

  • That can't be the whole script.  I need to see everything, please, including where you're assigning values to those variables.  And you still haven't answered how you're actually doing this.  Don't forget we can't see your screen.

    John

  • Make sure that you can access the full path
    Confirm if Data folder exists and has permissions

Viewing 14 posts - 1 through 13 (of 13 total)

You must be logged in to reply to this topic. Login to reply