Retrieving quot;output messagesquot; from batch SQL command (SQL Server)(检索“输出消息从批处理 SQL 命令 (SQL Server))
问题描述
我正在针对 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)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:检索“输出消息"从批处理 SQL 命令 (SQL Server)


基础教程推荐
- 有没有办法忽略 2GB 文件上传的 maxRequestLength 限制? 2022-01-01
- c# Math.Sqrt 实现 2022-01-01
- SSE 浮点算术是否可重现? 2022-01-01
- 将 Office 安装到 Windows 容器 (servercore:ltsc2019) 失败,错误代码为 17002 2022-01-01
- 如何在 IDE 中获取 Xamarin Studio C# 输出? 2022-01-01
- MS Visual Studio .NET 的替代品 2022-01-01
- 将 XML 转换为通用列表 2022-01-01
- 如何激活MC67中的红灯 2022-01-01
- 为什么Flurl.Http DownloadFileAsync/Http客户端GetAsync需要 2022-09-30
- rabbitmq 的 REST API 2022-01-01