Skip to content

Instantly share code, notes, and snippets.

@vitor-caetano
Created January 20, 2017 15:27
Show Gist options
  • Save vitor-caetano/1fd735d4209bebfcadf7dbdf17dbf068 to your computer and use it in GitHub Desktop.
Save vitor-caetano/1fd735d4209bebfcadf7dbdf17dbf068 to your computer and use it in GitHub Desktop.
Get progress of SQL Server shrink database execution
SELECT
percent_complete,
dateadd(second,estimated_completion_time/ 1000, getdate()) as est_completion_time
FROM
sys.dm_exec_requests
WHERE
command = 'DbccFilesCompact'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment