Trying to remove an extra database file from a database using EMPTYFILE on SQL Server 2008 R2.
use [MYDATABASE]
DBCC SHRINKFILE (MY_DATABASE_7, EMPTYFILE);
use master
ALTER DATABASE [MY_DATABASE]
REMOVE FILE MY_DATABASE_7;
And getting this error
Msg 2555, Level 16, State 1, Line 2 Cannot move all contents of file "MY_DATABASE_7" to other places to complete the emptyfile operation.
The other database files aren't limited in growth in anyway. There is more than enough disk space
And there is practically nothing left in the 7th file.
So there is no reason why I can't remove this 7th file.
Any thoughts as to why SQL Server is rejecting the EMPTYFILE ?
FREESYSTEMCACHE
and proc cache and rerun the operation. There will be a performance hit if you are doing it on a PROD server.