Yesterday, I asked a question about how to reduce the size of a database. The community suggested using the command
dbcc shrinkdatabase. I followed their advice and ran the command for over 24 hours. However, I encountered an error because my hard disk drive was full. Instead of decreasing the file size, the
dbcc shrinkdatabase command seemed to be increasing it (see photo links). Moreover, the original free space in the database is now filled up, even though no additional data was added. Did I make a mistake?
This is the exact query I ran:
DBCC SHRINKDATABASE (<DB>,1); GO changed it to
DBCC SHRINKDATABASE (<DB>,10); GO after I ran out of space (currently still running, nad have not finished. Stopped in the middle)
- I am aware that this will fragment my Indexes, and I am fine with that
- This is a Dev environment, no additional data goes in nor out
- I am running SQL Server and SSMS 2017
Can someone please help me. Is there something I did wrong? Should I change the query?