MSG 5121 Not a valid Directory when Moving Model database

  • I am trying to move my model database using the following script

    ALTER DATABASE model

    MODIFY FILE ( NAME = modeldev,FILENAME = 'Z:\MSSQLSERVER\MSSQL\DATA\model.mdf')

    ALTER DATABASE model MODIFY FILE ( NAME = modellog,FILENAME = 'Z:\MSSQLSERVER\MSSQL\DATA\modellog.ldf')

    I keep getting the following error;

    Msg 5121, Level 16, State 1, Line 2

    The path specified by "Z:\MSSQLSERVER\MSSQL\DATA\model.mdf" is not in a valid directory.

    at first I thought it was because the directory could not be seen by sql so I assigned MSSSQLSERVER rights to the data directory but that did not change my error. It appears to be a permissions issue. Anyone have any suggestions.

    I also ran this script to try and validate the current file and it works but it cannot see anything in the z drive

    DECLARE @output INT

    EXEC @output = XP_CMDSHELL 'DIR "E:\MSSQL11.MSSQLSERVER\MSSQL\DATA\model.mdf" /B', NO_OUTPUT

    IF @output = 1

    PRINT 'File Donot exists'

    ELSE

    PRINT 'File exists'

  • Is there anything different about that Z: drive versus the other drives the server uses? Different configuration, etc? Local versus SAN?

Viewing 2 posts - 1 through 1 (of 1 total)

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