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

2 answers

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://video2.skills-academy.com/en-us/azure/azure-sql/database/service-tier-hyperscale

    Thanks for your help.

    3 people found this answer helpful.

  2. Balmukund 81 Reputation points Microsoft Employee
    2024-07-11T19:41:19.72+00:00

    Last week we announced that DBCC SHRINK* commands are now available in Azure SQL Database Hyperscale tier. http://aka.ms/hs-shrink-preview

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.