Azure SQL Database not supporting DBCC SHRINKFILE

Stephen Planck 21 Reputation points
2021-03-10T04:57:13.093+00:00

Hey guys, I have recently tried to shrink a database file in Azure SQL Database, but am getting a message saying this function is not supported in this version of SQL Server. Anybody know when this support was removed? What is the replacement in Azure SQL DB to perform this function? The documentation still says it is supported, so this is a bit strange. Stephen

Azure SQL Database
{count} vote

1 answer

Sort by: Most helpful
  1. Stephen Planck 21 Reputation points
    2021-03-16T23:35:48.577+00:00

    Hey there,

    We figured out the issue. We're using the hyperscale service tier which apparently doesn't support SHRINKFILE. This is from the official Microsoft documentation:

    "DBCC SHRINKDATABASE or DBCC SHRINKFILE isn't currently supported for Hyperscale databases."

    It doesn't mention anything about an alternative option, so I'm not sure if this is even possible with the hyperscale service tier.

    If anyone is interested, here's the documentation page where we found the answer:

    https://learn.microsoft.com/en-us/azure/azure-sql/database/service-tier-hyperscale

    Thanks for your help.

    3 people found this answer helpful.