Problemas con trigger
Publicado por igborn (5 intervenciones) el 01/03/2011 16:26:22
Hola,
Tengo este trigger que funciona casi bien.
Cuando inserta datos, no inserta una fila como debería ser, sino, que inserta la misma fila 3 veces y no veo el fallo.
gracias
CREATE trigger [TRG_ZONE] ON [dbo].[trainzone]
FOR INSERT
AS
delete from tsmokeactive
where (procesado=1)
insert tsmokeactive (timedate, location, description)
SELECT tsmoke.timedate, tsmoke.location, trainzone.description
FROM trainzone, tsmoke
where trainzone.location = tsmoke.location AND
tsmoke.description not like '%Cleared%'
Tengo este trigger que funciona casi bien.
Cuando inserta datos, no inserta una fila como debería ser, sino, que inserta la misma fila 3 veces y no veo el fallo.
gracias
CREATE trigger [TRG_ZONE] ON [dbo].[trainzone]
FOR INSERT
AS
delete from tsmokeactive
where (procesado=1)
insert tsmokeactive (timedate, location, description)
SELECT tsmoke.timedate, tsmoke.location, trainzone.description
FROM trainzone, tsmoke
where trainzone.location = tsmoke.location AND
tsmoke.description not like '%Cleared%'
Valora esta pregunta


0