Skip to main content
Improved suggested edit
Source Link
Paul White
  • 90.3k
  • 30
  • 424
  • 663

We have a need to fit a database in 4G4GB in order to use ms sql express editionSQL Server Express Edition. I I started from 7Ga 7GB database, and found a lot of not neededunneeded records, and deleted them. After Shrinkshrinking, the database size is 4.6G6GB, and 748 MB is free (according to database properties).

However, when iI execute exec sp_spaceused, I have 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
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 biterelease at least some of this unused space? Also I know table, which occupied it.

Update: is it worth to trytrying to rebuild table indexes?

ALTER INDEX ALL ON Production.Product REBUILD

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 748 MB is free (according to database properties).

However, when i execute exec sp_spaceused, I have 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

We have a need to fit a database in 4GB in order to use SQL Server Express Edition. I started from a 7GB database, and found a lot of unneeded records, and deleted them. After shrinking, the database size is 4.6GB, and 748 MB is free (according to database properties).

However, when I execute exec sp_spaceused, I have 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 release at least some of this unused space? Also I know table, which occupied it.

Update: is it worth to trying to rebuild table indexes?

ALTER INDEX ALL ON Production.Product REBUILD

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 After Shrink database size is 4.6G, and 748MB748 MB is free (according to database properties)(according to database properties).

However, when i execute exec sp_spaceused i am having exec sp_spaceused, I have 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 iI bite at least some of this unused space? Also I know table, which occupied it.

update:Update: is it worth to try to rebuild table indexes?

ALTER INDEX ALL ON Production.Product REBUILD

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

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 748 MB is free (according to database properties).

However, when i execute exec sp_spaceused, I have 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
Post Migrated Here from stackoverflow.com (revisions)
Source Link

Shrink database after removing extra data

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