Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 383
  • Last Modified:

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.
SpacePic.jpg
0
rdray
Asked:
rdray
1 Solution
 
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:

TRUNCATE TABLE dbo.SYSDATABASELOG

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.
0
 
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
0
 
Ephraim WangoyaCommented:

Try shrinking the database

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

0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
lcohanDatabase AnalystCommented:
Caution shrinking live on line databases even on SQL 2008.
0
 
rdrayAuthor Commented:
All these are great.. I have done all of them with no change.
0
 
lcohanDatabase AnalystCommented:
do you have a clustered index on it? if not try create one then drop, if yest try drop then re-create.
0
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.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now