r/SQLServer • u/boyadobo • Nov 18 '25
Question Auto shrink on Azure SQL Database
Does anyone have an experience with setting the AutoShrink feature to ON for Azure SQL Database?
I actually tried setting it to ON, but it’s been a week and it has not shrunk anything. Just curious if there’s a criteria that Azure follows to be able to start shrinking the database?
BTW, Database is in Hyperscale Tier and I was just conducting a test if Azure will autoshrink it while it is running with the cheapest setting which is 2 cores.
Thanks!
6
Upvotes
8
u/Black_Magic100 Nov 18 '25
I didn't even realize auto shrink was an option, but this seems like an awful idea. If you are an expert and know what you are doing along with the implications then by all means continue on, but if you have less experience in this realm I'd suggest taking a step back to understand why you want to do this in the first place.
Relevant Ozar rant article: https://www.brentozar.com/archive/2009/08/stop-shrinking-your-database-files-seriously-now/
To be fair, you are referring to the cloud where you are actually charged for storage, but it still seems like a bad idea to me 😁
3
u/alinroc 4 Nov 18 '25
What are you hoping to gain by enabling it?
Your database can only shrink if you've deleted a significant amount of data. And it'll just re-grow when you add more.
The documentation says that Azure doesn't do auto-shrinks.
2
u/FreedToRoam Nov 18 '25
usually autoshrink option is not recommended on a sql database but I suppose there can be use cases for it. I haven't given it much thought why would anyone do autoshrink.
1
u/Itsnotvd Nov 18 '25
Sounds like you are trying to cure the symptom not the disease.
Lots of DB instances out there using microsoft maintenance command and processes in very inefficient ways. That's what happened to me and making maintenance more efficient mimimized db bloat.
Might want to figure out why its expanding and remedy that root cause. 3 TB is a lot of data to be shrinking (look up the negative aspects to shrinking). In my case switching to Ola Hallengren's solution for maintenance addressed it.