C#SQL Server备份%的阅读 [英] c# sql server backup percent read

查看:116
本文介绍了C#SQL Server备份%的阅读的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

SQL命令

BACKUP DATABASE [databasesample] TO  DISK = N'D:\kkk\test.bat' WITH  INIT ,  NOUNLOAD , 
NAME = N'name test',  NOSKIP ,  
STATS = 5,  DESCRIPTION = N'test',  NOFORMAT 

结果

5 percent processed.
10 percent processed.
15 percent processed.
20 percent processed.
25 percent processed.
30 percent processed.
35 percent processed.
40 percent processed.
45 percent processed.
50 percent processed.
55 percent processed.
60 percent processed.
65 percent processed.
70 percent processed.
75 percent processed.
80 percent processed.
85 percent processed.
90 percent processed.
95 percent processed.
Processed 30960 pages for database 'databasesample', file 'sample_Data' on file 1.
100 percent processed.

我要赶在C#的百分比。我觉得 BeginExecuteNonQuery的()函数完成。但我不知道究竟如何。建议?

I want to catch the percentage with C#. I think BeginExecuteNonQuery() function is done. but I do not know exactly how. Suggestions?

推荐答案

另外,从使用SMO方法等已表示,或潜入的<一个的 PERCENT_COMPLETE 列HREF =htt​​p://msdn.microsoft.com/en-us/library/ms177648.aspx相对=nofollow> sys.dm_exec_requests视图 ,还有在这里问了另一个问题:怎么我捕捉那些 5%的完整在C#中的消息

Besides from using the SMO method as other have indicated, or from sneaking the percent_complete column of sys.dm_exec_requests, there is also another question asked here: how to I capture those 5 percent complete messages in C#?

完成百分比是提示性消息。在C#中的所有信息消息可以从 <被捕获$ C C> SqlConnection.InfoMessage $ 事件。

The percent complete is an informational message. All informational messages in C# can be captured from the SqlConnection.InfoMessage event.

这篇关于C#SQL Server备份%的阅读的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆