From SSMS I removed a secondary file (named tempdev2) in the PRIMARY filegroup of tempdb and lowered the maximum size for tempdev. It erred out saying:
The file "K:\sqldata\PROD_CRICKET\tempdev2.ndf" has been modified in the system catalog. The new path will be used the next time the database is started.
Msg 5042, Level 16, State 1, Line 1
The file 'tempdev2' cannot be removed because it is not empty.
I cancelled out of the tempdb properties and then opened them back up and noticed that my max size change was reflected and strangely, tempdev2 had disappeared. A little suspicious, I checked the file system and discovered that tempdev2 still existed. Deleting it from the OS fails, as it's still in use. I then ran DBCC SHRINKFILE(tempdev2,EMPTYFILE), but received:
Could not locate file 'tempdev2' for database 'tempdb' in sys.database_files. The file either does not exist, or was dropped.
When I look in sys.database_files, I see tempdev2 (fileid 3), but when I'm in sys.master_files I do not. Any idea what happened and more importantly, how I can resolve this without restarting the instance?
Thanks for your help.