Skip to Content
0
Former Member
Feb 23, 2010 at 04:46 AM

DB File could not be deleted. (SQL Server 2000)

67 Views

Hi,

My Objective is to delete a DB File from SQL Server 2000.

Database Name : ABC

Total No of DB Files : 8

File to be deleted : ABCDATA2

I followed the note 363018 and before deleting the file, I used the SHRINK command EMPTYFILE option to empty the contents.

It appeared that the operation successfully completed. I could confirm the message. After that when I executed the alter database command to remove the above said DB file, it is throwing the following error and the command fails :

-


The file 'ABCDATA2' cannot be removed because it is not empty

-


When I checked for the usage of the above said DB File, it is showing as 1.8MB

Before I shrinked the above file, the usage was around 88 GB. From this I could understand that almost all the contents have been moved to the rest of the DB files.

I had used the following commands:

use ABC

DBCC TRACEON(8901)

DBCC SHRINKFILE('ABCDATA2',EMPTYFILE)

ALTER DATABASE ABC REMOVE FILE ABCDATA2

DBCC TRACEOFF(8901)

(Error Message)

The file 'ABCDATA2' cannot be removed because it is not empty

Would like to know if you had faced the similiar issue and the solution you had applied it to rectify it.

Best Regards

Raghunahth L

-


General System Information

RAM 4GB

CPU Xeon 2.7Ghz

SQLServer Version : SQLServer2000 3a hotfix 8.00.919

OS WindowsServer2003 32Bit (No SP)

R/3 Enterprise4.7 Extension1.1

Kernel Patch WAS640 247

BASIS SP Level: SAP_BASIS 620 0047 SAPKB62047