Approximate completion time for operations such as SQL query backup or restore

Source: Internet
Author: User

The time required to complete the query is fairly accurate.

--Query The approximate completion time for operations such as backup or restore   Selectcommand, Percent_complete, Running_time=Convert(varchar,((DateDiff(S,start_time,getdate()))/3600))+'Hour,'                +Convert(varchar,((DateDiff(S,start_time,getdate()))%3600/ -))+'min,'                +Convert(varchar,((DateDiff(S,start_time,getdate()))% -))+'sec', Est_time_to_go=Convert(varchar, (Estimated_completion_time/ +)/3600)+'Hour,'                  +Convert(varchar, (Estimated_completion_time/ +)%3600/ -)+'min,'                  +Convert(varchar, (Estimated_completion_time/ +)% -)+'sec', Start_time=Convert(Char( -), Start_time, -), Est_completion_time=Convert(Char( -),DateAdd(Second,estimated_completion_time/ +,getdate()), -), S.text    fromsys.dm_exec_requests R Crossapply Sys.dm_exec_sql_text (r.sql_handle) swhereR.commandinch('BACKUP DATABASE','RESTORE DATABASE','BACKUP LOG','RESTORE LOG','dbccfilescompact','Dbccspacereclaim')  

Approximate completion time for operations such as SQL query backup or restore

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.