• I am not sure what bit of the SHRINKFILE processing causes it to fail after the EMPTYFILE keyword is used, but fail it does. Even if you issue a SHRINKFILE ... EMPTYFILE and cancel the command my recollection is that all subsequent SHRINKFILES will quickly fail until the file gets reopened.

    This means that cancelling a SHRINKFILE ... EMPTYFILE will leave the file not empty but unshrinkable until it is reopened. After it is reopened you can issue a new SHRINKFILE to clear out more data.

    Original author: https://github.com/SQL-FineBuild/Common/wiki/ 1-click install and best practice configuration of SQL Server 2019, 2017 2016, 2014, 2012, 2008 R2, 2008 and 2005.

    When I give food to the poor they call me a saint. When I ask why they are poor they call me a communist - Archbishop Hélder Câmara