-2

I have a database with a lot of tables and I created a new file in the primary filegroup, I haven't inserted any new data yet but when I try to delete this new file, I get this error

The File ‘newfile’ Cannot be Removed Because it is Not Empty

How can I delete this file?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459

1 Answers1

1

ok, the solution was as Mitch Wheat indicated in the link that he showed. I had to empty the file using:

DBCC SHRINKFILE(newfile,EMPTYFILE)

then it can be eliminated using:

ALTER DATABASE DBNAME REMOVE FILE newfile