FILEGRUOP NAME MODIFY ERROR

  • Hİ everybody.i got a problem

    first i add filegroup;

    ALTER DATABASE test

    ADD FILEGROUP testgrup1

    then;(i add a data file)

    ALTER DATABASE test

    ADD FILE (NAME = test5, FILENAME = 'c:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\test5.ndf',

    SIZE=8MB, MAXSIZE=100MB,FILEGROWTH=10MB )

    TO FILEGROUP testgrup1

    GO

    -------------------------------------

    ALTER DATABASE test

    MODIFY FILE

    ( NAME = testgrup1, NEWNAME = testgrup3 )

    ALTER DATABASE test

    MODIFY FILE

    ( NAME = testgrup2, NEWNAME = testgrup4 )

    ^^^ BUT When I wrote this code, gives the following error!! vvv

    Msg 5041, Level 16, State 1, Line 1

    MODIFY FILE failed. File 'testgrup1' does not exist.

    Msg 5041, Level 16, State 1, Line 5

    MODIFY FILE failed. File 'testgrup2' does not exist.

  • It seems you want to modify the filegroup name but your statement is to modify the file name. Use MODIFY FILEGROUP instead. But if you are trying to modify the file name, make sure the logical name is right to avoid the error you have.

  • It gives this error 🙁

    Msg 102, Level 15, State 1, Line 199

    Incorrect syntax near 'MODIFY'.

  • Here is the correct syntax:

    ALTER DATABASE Staging41 MODIFY FILEGROUP filegroup1 NAME = filegroup2

    It is certainly not the same as the syntax of changing the file name.

  • yes:-)thanks you very much.

    How to delete the filegroup

    ALTER DATABASE test

    REMOVE FILEGROUP testgrup3

    GO

    DONT DELETE:exclamationmark:

  • sorry deleted now

    thanks a lot

Viewing 6 posts - 1 through 5 (of 5 total)

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