If you have a SQL server free edition and it isn’t working with the message:
CREATE/ALTER DATABASE failed because the resulting cumulative database size would exceed your licensed limit of 2048 MB per database.
Unfortunately the ”dbcc cleantable “ does not help, it cleans the table unused space BUT the shrink operation does not decrease the database size
You have another option: reorganize the indexes and shrink the db: it works giving you some hours of new life, just the time to install SQL2008 express R2 with 8GB limit
Follow this steps:
- Open Sql Server Management Studio
- Run sp_helpdb ‘YourDb’ and save the results
- Analyze the tables with the bigger size, use this script:
- Change in the script the final query :
- To :
order by cast(replace(IndexSize,' KB','') as int) desc
Hope it helps!