|
Posted by Dan Guzman on 06/19/05 18:15
You can't make a trigger fire once per row in SQL 2000. As John mentioned,
you need a unique row identifier that does not change so that you can
correlate the before/after values in your update trigger. You can then use
a single insert statement in your trigger like the example below:
INSERT INTO HIST_CHG_PRECO
SELECT
GetDate(),
ins.PRODNO,
ins.FRCLNO,
ins.ISCOMPRA,
del.PRECO,
ins.PRECO
FROM inserted ins
JOIN deleted del ON ins.PK = del.PK
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Lucio Chiessi [VORio]" <lucio@vorio.eti.br> wrote in message
news:1119184019.516192.94790@g43g2000cwa.googlegroups.com...
> Ooops!!
>
> I think that triggers was fired once per row. Am I wrong so!?
> My trigger code was made to be used once per row and not once per
> statement.
> There is another way to made trigger be fired once per row?
>
> Thanks a lot for your replay!!
>
> Lucio
>
Navigation:
[Reply to this message]
|