1 つのテーブルに「After Delete」トリガーを適用しました。以下はスクリプトです。
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."
削除トリガーが適用されたときに、上記の削除ステートメントを使用して複数の行を削除するにはどうすればよいですか。