问题描述
我正在针对 SQL Server 批量执行多个离散查询.例如:
<上一页>更新 tableX 设置 colA = 'freedom';从客户中选择姓氏;插入表 Y (a,b,c) 值 (x,y,z);现在,我想在 DataSet(来自 select 语句)中捕获结果,这很容易做到……但是我如何也捕获来自该命令的元"响应,类似于查询分析器/SQL 的方式Mgt Studio 在显示消息"选项卡并显示类似于以下内容时会执行此操作:
<上一页>(1 行受影响)(更新了 2 行)查看 SQL 连接事件.我认为这就是你所追求的:http://msdn.microsoft.com/en-us/library/a0hee08w.aspx
I'm executing several discrete queries in a single batch against SQL Server. For example:
update tableX set colA = 'freedom'; select lastName from customers; insert into tableY (a,b,c) values (x,y,z);
Now, I want to capture the result in a DataSet (from select statement) which is easy enough to do...but how do I also capture the "meta" response from that command similar to the way Query Analyzer/SQL Mgt Studio does when it displays the "Messages" tab and diplays something similar to:
(1 Row affected) (2 Rows Updated)
look into SQL Connection events. I think that's what you're after: http://msdn.microsoft.com/en-us/library/a0hee08w.aspx
这篇关于检索“输出消息"从批处理 SQL 命令 (SQL Server)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!