SQL Datasize on Table Large with 0 records in table

I deleted all the rows in a table and the data size is still 7.5 gb.  Who do I release all that unused space.
Who is Participating?
Ryan McCauleyData and Analytics ManagerCommented:
This happens when you DELETE records from a table - they're not actually deleted, just marked as deleted, and then overwritten later.

If you want to free up the space, issue this instead:


Open in new window

This will reset the high water mark on the table and free up the reserved space. You'll still have the space allocated in your data file, though - you'll need a DBCC SHRINKDB to free that up.
lcohanDatabase AnalystCommented:
You could try DBCC UPDATEUSAGE on that table like below and check after that:

DBCC UPDATEUSAGE ('db_name','table_name')  -- WITH NO_INFOMSGS
Ephraim WangoyaCommented:

Try shrinking the database

Right click on the database, select Tasks->Shrink->Database

Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

lcohanDatabase AnalystCommented:
Caution shrinking live on line databases even on SQL 2008.
rdrayAuthor Commented:
All these are great.. I have done all of them with no change.
lcohanDatabase AnalystCommented:
do you have a clustered index on it? if not try create one then drop, if yest try drop then re-create.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.