Converting Plsql Trigger to Tsql
Posted
by
mcb
on Stack Overflow
See other posts from Stack Overflow
or by mcb
Published on 2011-01-11T17:50:38Z
Indexed on
2011/01/11
17:53 UTC
Read the original article
Hit count: 372
Hi, I am not good at tsql.How can does following trigger in tsql?For each doesnt work in tsql.
CREATE OR REPLACE TRIGGER DSS.TRG_DEPO_STOK_IZLEME
BEFORE INSERT OR UPDATE
ON DSS.CR_DEPO_STOK FOR EACH ROW
BEGIN
INSERT INTO CR_DEPO_STOK_IZLEME
(ID_DEPO_STOK_IZLEME
, ID_DEPO_STOK
, MT_MIKTAR_ESKI
, MT_MIKTAR_YENI
, EKLEME_TARIHI
)
VALUES (SEQ_ID_DEPO_STOK_IZLEME.NEXTVAL
, :NEW.ID_DEPO_STOK
, :OLD.MT_MIKTAR
, :NEW.MT_MIKTAR
, SYSDATE
);
EXCEPTION
WHEN OTHERS
THEN
NULL;
END;
© Stack Overflow or respective owner