Friday, May 15, 2009

One or more files listed in the statement could not be found or could not be initialized.

The error message
Msg 5009, Level 16, State 8, Line 1
One or more files listed in the statement could not be found or could not be initialized.
is a run time error message and appears when you try to use a file in a statement but this file could not be found or initialized. There may be several root causes for this error. So to execute the statement you have to remove the root cause.
Please see comments for an example.

3 comments:

  1. Wow! This has got to be the most helpful article I have ever read. You basically just repeated the description in the error message.

    Would be more helpful if you could provide some sample cases instead of saying several root causes.

    Tnx!

    ReplyDelete
  2. One example that i found on sql-server-performance.com is as follows
    ALTER DATABASE MyExample
    ADD FILE
    (
    NAME = Test1dat2,
    FILENAME = 'abc.ndf',
    SIZE = 5MB,
    MAXSIZE = 10MB,
    FILEGROWTH = 50MB
    );
    Here a file named abc.ndf is being tried to added. As .ndf is a non primary database file extension. So file initialization can not take place and error code is returned. I will add here more scenarios if found.

    ReplyDelete
  3. This error may also occur if you try to drop a file from file group but file does not exist there.

    ReplyDelete

Any Comments: