在SQL查询期间阅读消息 [英] Read Messags during SQL Query

查看:95
本文介绍了在SQL查询期间阅读消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



如果运行查询,C#中是否可以读取sql中通常显示的消息?

示例:如果我在下面运行查询

Hi

Is there a way in C# to read the what would normally be the Messages in sql if running a query?

example : if I ran the query below

RESTORE DATABASE [TestDatabase] 
	FROM  DISK = N'c:\backups\TestDatabase.bak' 
	WITH  FILE = 1,  
	MOVE N'onecom_Data' TO N'D:\Databases\DATA\TestDatabase.mdf',  
	MOVE N'onecom_Log' TO N'D:\Databases\LOG\TestDatabase_1.ldf',  
	NOUNLOAD,  STATS = 1
GO



它将为我提供百分之一的备份状态.我可以从C#中读取SSMS中显示的数据吗?



it would give me the status of the backup every percent. Can I read that data from C# as it would appear in SSMS?

推荐答案

不,我不能认为这与消息泵有关不存在.
这不是一个很科学的解释,但是几年前我确实花了一些时间对此进行调查.
No you can''t I think it has something to do with a message pump that doesn''t exist.
Not a very scientific explanation, but I did spend some hour investigating this a few years back.


这篇关于在SQL查询期间阅读消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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