Hi Sergio,
It's not correct. In triggers you work with special Deleted and Inserted tables which represent records state before and after update. Obviously, there is no Deleted record for INSERT and no Inserted record for DELETE. In your case you would join INSERTED table with trnsaction table for UPDATE statement.
Also you have to take in account that trigger may be called recursively if you issue UPDATE statement from the trigger. You'll have to check for that too.
>Here is the triggers,
>it seems to be working fine
>
>
>CREATE TRIGGER amount ON [dbo].[trnsaction]
>FOR INSERT, UPDATE
>AS
>DECLARE @type int
>
>SELECT @type = tcodeid FROM trnsaction
>IF @type = 1
>UPDATE trnsaction SET amount = -amount
>
>
>
--sb--