omacron
Technical User
- Feb 5, 2002
- 149
Hi
This is a MS SQL Express 2005 database. It was getting close to the 4GB cap so purged some data out. It only got about 200MB back when I was expecting around 800-1,000MB. So I shrunk (MS SQL Management Studio => Expand Server => Expand Databases => Right click on the database => Right click => Tasks => Shrink. Check off "Reorganize files before..." click ok). This didn't make a difference. I ran this script;
Still no difference. So then I ran;
Gives the results;
How do a recover that unused space?
thanks
This is a MS SQL Express 2005 database. It was getting close to the 4GB cap so purged some data out. It only got about 200MB back when I was expecting around 800-1,000MB. So I shrunk (MS SQL Management Studio => Expand Server => Expand Databases => Right click on the database => Right click => Tasks => Shrink. Check off "Reorganize files before..." click ok). This didn't make a difference. I ran this script;
Code:
ALTER DATABASE [DBNAME] SET AUTO_SHRINK ON
GO
ALTER DATABASE [DBNAME] SET RECOVERY SIMPLE
GO
BACKUP LOG [DBNAME] WITH TRUNCATE_ONLY
GO
DBCC SHRINKDATABASE ([DBNAME], 1, NOTRUNCATE)
GO
DBCC SHRINKDATABASE ([DBNAME], 1, TRUNCATEONLY)
GO
Code:
exec sp_spaceused
Code:
Reserved Data Index Size Unused
3,581,848 KB 2,129,072 KB 545,440 KB 907,336 KB
How do a recover that unused space?
thanks