SQL-Server: Is there a SQL script that I can use to determine the progress of a SQL Server backup or restore process?

前端 未结 17 1367
独厮守ぢ
独厮守ぢ 2020-12-04 06:16

When I backup or restore a database using MS SQL Server Management Studio, I get a visual indication of how far the process has progressed, and thus how much longer I still

17条回答
  •  时光说笑
    2020-12-04 07:07

    Yes. If you have installed sp_who2k5 into your master database, you can simply run:

    sp_who2k5 1,1
    

    The resultset will include all the active transactions. The currently running backup(s) will contain the string "BACKUP" in the requestCommand field. The aptly named percentComplete field will give you the progress of the backup.

    Note: sp_who2k5 should be a part of everyone's toolkit, it does a lot more than just this.

提交回复
热议问题