Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Trigger
Message
General information
Forum:
Visual FoxPro
Category:
Client/server
Title:
SQL Trigger
Miscellaneous
Thread ID:
00227038
Message ID:
00227038
Views:
72
I am attempting to create a SQL 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 the correct way?
Richard DeZeeuw
DeZeeuw Software Inc.
Reply
Map
View

Click here to load this message in the networking platform