Deleting Records Not Releasing Space on Database

Hi,

I deleted about 1 million records but it does not seem to have freed up any space. Any ideas why??

Table Size Before Deleting Records

Table size before deletion statement

Table Size After Deletion

Table size after deletion statement

The table design is as follows...

pkSessionID - varchar(50)

fkUserId - uniqueidentifier

DateCreated - smalldatetime

DateLastAccessed - smalldatetime

Thanks in advance,

Will

September 4th, 2013 5:56am

Hi 

Run sp_spaceused sp

use <YourDbName>

go

exec  sp_spaceused @updateusage = N'TRUE';

vt

Free Windows Admin Tool Kit Click here and download it now
September 4th, 2013 6:00am

Try the below:

Rebuild CLustered index and DBCC UPDATEUSAGE(0).

September 4th, 2013 6:05am

Hi,

That just tells me how much space my database is using.

It does not free up any space or tell me why having reduced the table size by 70% no database space has been released.

I have just created a new copy of tblSessionID and appended the records from the existing tblSessionID table. This now takes up 20mb instead of the 168mb.

WHY??

Free Windows Admin Tool Kit Click here and download it now
September 4th, 2013 6:08am

Run 

DBCC UPDATEUSAGE (<table Name> )

or 

sp_spaceused  @updateusage = N'True'

Amish shah

http://blog.sqltechie.com

September 4th, 2013 6:09am

you can use DBCC CLEANTABLE command to reclaim the disk space after deleting the rows from a table check the link for more information

http://blog.sqlauthority.com/2008/01/11/sql-server-reclaim-space-after-dropping-variable-length-columns-using-dbcc-cleantable/

Free Windows Admin Tool Kit Click here and download it now
September 4th, 2013 6:15am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics