1

Is there a way to report a percentage progress of an own query using a sys.dm_exec_requests field: percent_complete? msdn link

It works quite well for a BACKUP/RESTORE/SHRINK operations, for example:

SELECT percent_complete FROM sys.dm_exec_requests WHERE command = 'DbccFilesCompact'

25.677

but can it be used with user queries?

malpka
  • 83
  • 1
  • 5
  • Possible duplicate of [Monitoring the progress of an SQL query in SQL SERVER](http://stackoverflow.com/questions/3289670/monitoring-the-progress-of-an-sql-query-in-sql-server) – CPMunich Feb 19 '16 at 14:53

1 Answers1

1

You MAY be able to get a VERY ROUGH approximation comparing the query plans estimated count vs the actual rows in sys.dm_exec_query_profiles.

This will be a very bad indicator if the statistics are not current or if the selected query plan is 'sub-optimal'.

And as noted, this DMV may not be available to you, as it is 2014+ specific.

Rawheiser
  • 1,200
  • 8
  • 17