DBCC Cleantable not reclaimimn space

Posted on 2006-03-24
Last Modified: 2012-06-27

I have a table which sp_spaceused tells me has a gig of unused space.  I'd like to reorganize the table to reclaim the space.  I did a dbcc cleantable('db', 'table').   After minutes of work, the dbcc ended reporting success.  But, sp_spaceused still tells me the dbcc had no effect.  The unused space is still unclaimed.

Can any one tell me how to get this table to give up it's unused space?

Question by:jflanner
    LVL 15

    Expert Comment

    LVL 75

    Accepted Solution

    >>Can any one tell me how to get this table to give up it's unused space?<<
    Unless space is a premium, in general it is not recommended to do this.  However, if you insist take a look at the DBCC SHRINKDATABASE and DBCC SHRINKFILE functions in Books Online.

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Join & Write a Comment

    I wrote this interesting script that really help me find jobs or procedures when working in a huge environment. I could I have written it as a Procedure but then I would have to have it on each machine or have a link to a server-related search that …
    JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
    Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
    Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now