更新的查询导致多表更新

时间:2018-03-07 16:46:11

标签: sql sql-server database tsql

我在SQL Server中运行了更新查询:

update benefitplandetails 
set memberterminationage=150
where benefitid = 1 
and planid in (select planid 
               from division 
               where divisionid not in (64, 65))

在此之前,我运行了一个具有相同where条件的select命令,结果是14行。但是当我使用相同的where条件运行更新查询时,它返回了多个结果。

结果是这样的:

924 rows affected 
0 rows affected
14 rows affected 

现在我不知道为什么单个更新查询会导致多次更新,以及如何知道哪些表受到影响。

我还检查了表有触发器。

0 个答案:

没有答案