General information
Forum:
Microsoft SQL Server
Category:
Database management
I have several databases that have a lot of «Unused Space».
I can't figure out why nor how to free that space.
Here is the situation:
I have several tables in the database that report the following kind of values from sp_spaceused:
Reserved: 300000 KB
Data: 38000 KB
index_size: 2500 KB
Unused: 258000 KB
But I can't in any way recover this space. Not using dbcc shrinkdatabase nor using dbcc shrinkfile.
The only way I can free the space is to bulk copy the data out of each table and then back in.
If in the table where I issued the sp_spaceused before (the example above) i do:
select * into newtable from oldtable
drop oldtable
and recreate the primary keys, indexes, etc. on the new table, when i do a sp_spaceused on this new table i get something like:
Reserved: 21000 KB
Data: 20000 KB
index_size: 500 KB
Unused: 80 KB
Can anyone help me please ? How do I recover the space without bulk copying every table out and in ?
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only