Problema trigger ERROR 1442

giovedì 11 febbraio 2010 - 12.42

violetFairy Profilo | Newbie

Ciao a tutti,

vorrei attivare un trigger del genere:

CREATE TRIGGER myTrigger
AFTER INSERT ON T1
FOREACH ROW
DELETE FROM T1
WHERE a= NEW.a
and b = 0;

ma dal momento in cui vado a fare un inserimento nella tabella T1 mi da questo errore:

ERROR 1442 (HY000): Can't update table 'T1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.

Come faccio ad attivare un trigger del genere?
Partecipa anche tu! Registrati!
Hai bisogno di aiuto ?
Perchè non ti registri subito?

Dopo esserti registrato potrai chiedere
aiuto sul nostro Forum oppure aiutare gli altri

Consulta le Stanze disponibili.

Registrati ora !
Copyright © dotNetHell.it 2002-2024
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5