Forum Discussion
MSSQL - Shrinking database to minimum available size doesn't work
pmrzyglod , first, why do you want to shrink the database at all? It is very small and shrink will cause index fragmentation and so performance issues.
What does the statement below return?
exec sp_spaceused;
olafhelper Hi, thanks for the reply.
This are the results of sp_spaceused;
Answering your question about the shrink. Issue here is that this DB works in express for demo purposes and at the beginning it wasn't a problem as the db was staying at around 4GB. After some time it kept to grow even tho data that was comming through wasn't bigger. So for now It keeps going up to 10GB and Im forced to keep less and less data. My opinion is that it is keeping reserved space for tables that once could grow bigger than usual and it broke the whole inflow.
Best regards
- olafhelperApr 23, 2024Bronze ContributorThere is a mismatch between the information; the database has only 771 MB "unallocated space" = free space, you can't shrink below.
- pmrzyglodApr 23, 2024Copper Contributor
olafhelper Hi, what do you mean by saying there is mismatch in the information?
Where does it come from then?
Why in the same time, GUI says that it have 4GB available and procedure says it's not?- olafhelperApr 24, 2024Bronze Contributor
pmrzyglod , really the same database?
Run command below to update stats about usage
dbcc updateusage(0);