为什么有一个额外的“(1 行受影响)"? [英] Why there is an extra "(1 row(s) affected)"

查看:54
本文介绍了为什么有一个额外的“(1 行受影响)"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每次执行 insert/update 时,SSMS 都会显示一个额外的 (1 行受影响).比如执行下面的SQL

声明@a table (a int)插入@a 值 (1), (2)更新@a 设置a = 3

SSMS 将显示以下消息.

<前>(受影响的 2 行)(1 行受影响)(受影响的 2 行)(1 行受影响)

我没有找到任何数据库/服务器触发器.什么可能导致额外的 (1 行受影响)?

解决方案

这通常意味着您打开了 actual execution plan 选项.执行计划作为额外的行集发送,导致额外的 (1 row(s)fluence) 消息.

要禁用实际执行计划,请按 Ctrl+M.

The SSMS shows an extra (1 row(s) affected) every time when I execute insert/update. For example, execute the following SQL

declare @a table (a int)
insert into @a values (1), (2)
update @a set a = 3 

And the SSMS will display the following message.

(2 row(s) affected)

(1 row(s) affected)

(2 row(s) affected)

(1 row(s) affected)

I didn't find any database/server trigger. What could cause the extra (1 row(s) affected)?

解决方案

That usually means you have the actual execution plan option turned on. The execution plan is sent as an extra rowset, resulting in an extra (1 row(s) affected) message.

To disable actual execution plan press Ctrl+M.

这篇关于为什么有一个额外的“(1 行受影响)"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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