我在一张表上应用了“删除后”触发器,下面是脚本:
ALTER TRIGGER [dbo].[onDelete_N_UR]
ON [dbo].[Notification_UnRead]
AFTER delete
AS
BEGIN
SET NOCOUNT ON;
declare @roid int
set @roid=(select ReachOutID from deleted(nolock)
where deleted.NotificaionType='reachoutlike')
update CACHE_Reachout
set CACHE_Reachout.LIKEcount=(select [dbo].[getReachout_Notification_Count](@roid,'like') )
where CACHE_Reachout.ReachOutID=@roid
结尾
现在我正在尝试使用以下 sql 语句批量删除一些行:
delete from Notification_UnRead where Notification_ID=****
它给了我错误
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression."
当应用删除触发器时,如何使用上述删除语句删除多行。