Azure SQL Database not supporting DBCC SHRINKFILE

Stephen Planck 21 Reputation points

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

    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:

    Thanks for your help.

    3 people found this answer helpful.