March 12, 2012 at 3:51 pm
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.
March 12, 2012 at 4:12 pm
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.
March 12, 2012 at 4:26 pm
It gives this error 🙁
Msg 102, Level 15, State 1, Line 199
Incorrect syntax near 'MODIFY'.
March 12, 2012 at 4:52 pm
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.
March 12, 2012 at 5:10 pm
yes:-)thanks you very much.
How to delete the filegroup
ALTER DATABASE test
REMOVE FILEGROUP testgrup3
GO
DONT DELETE:exclamationmark:
March 12, 2012 at 5:46 pm
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