Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Triggers
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
Triggers
Divers
Thread ID:
00227039
Message ID:
00227039
Vues:
65
I am attempting to create a trigger on a column when updating. The following is incorrect:

CREATE TRIGGER cus_name
ON dbo.customertable
FOR UPDATE AS
IF UPDATE(cus_name)
INSERT INTO AUDITTABLE(AUD_TABLENAME,AUD_COLNAME,AUD_OLD,AUD_NEW,AUD_DATE,LANID,COMPNO)
VALUES ('customertable','cus_name',deleted.cus_name,inserted.cus_name,GETDATE(),inserted.lanid,inserted.compno)


Does anybody know how to do it correctly?
Richard DeZeeuw
DeZeeuw Software Inc.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform