• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 296
  • Last Modified:

how to claim back space in sql server

hi,

We have deleted alot of data in a number of sql server tables - how do i now reorganise the tables to get the space back ?
i assume a shrink just reorganises the pages and will not release the space from the table ?

thanks
H
0
hraja77
Asked:
hraja77
  • 3
  • 2
  • 2
1 Solution
 
Scott PletcherSenior DBACommented:
A rebuild of the clustered index will get you the space back.

If you don't have a clustered index on the table, create one and then drop it.
0
 
venk_rCommented:
Or else try using the below command to  reclaim the space
DBCC CLEANTABLE('<database>', '<table>')
0
 
hraja77Author Commented:
the command below is only for dropped columns from what i can see

Or else try using the below command to  reclaim the space
DBCC CLEANTABLE('<database>', '<table>')
0
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

 
Scott PletcherSenior DBACommented:
Yes, and I think a rebuild will also reclaim the space from dropped column(s).
0
 
Scott PletcherSenior DBACommented:
But CLEANTABLE will not help for deleted rows, which seems like the requestor's situation.
0
 
venk_rCommented:
Do you have any Blob or image text data type in the table?
0
 
hraja77Author Commented:
thanks
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

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.

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