Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Triggers
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Triggers
Miscellaneous
Thread ID:
00227039
Message ID:
00227039
Views:
66
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.
Next
Reply
Map
View

Click here to load this message in the networking platform