You are here: Re: Problem in Update Trigger in SQL Server 7.0 - Need some help! « MsSQL Server « IT news, forums, messages
Re: Problem in Update Trigger in SQL Server 7.0 - Need some help!

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация