Shrink database after removing extra data
Posted
by Sergey Osypchuk
on Stack Overflow
See other posts from Stack Overflow
or by Sergey Osypchuk
Published on 2010-04-23T09:42:20Z
Indexed on
2010/04/23
9:53 UTC
Read the original article
Hit count: 297
We have a need to fit database in 4G in order to use ms sql express edition. I started from 7G database, and found a lot of not needed records, and deleted them. After Shrink database size is 4.6G, and 748MB is free (according to database properties).
However, when i execute exec sp_spaceused i am having interesting results:
DatabaseName Database_size unallocation space
xxxxxx 4726.50 MB 765.42 MB
Reserved Data index_size unused
3899472 KB 1608776 KB 1448400 KB 842296 KB
Any ideas, how can i bite at least some of this unused space? Also I know table, which occupied it.
update: is it worth to try to rebuild table indexes?
ALTER INDEX ALL ON Production.Product REBUILD
© Stack Overflow or respective owner