Skip to Content
0
Former Member
Sep 24, 2012 at 04:57 PM

Does hana DB tables support triggers on insert on update to create a row in log table

556 Views

In sql server i use triggers on table, when a new record is inserted or an existing repor is update, create a copy of that row to another log table.

This is useful in terms of managing delta's on any tables data.

This is how i create:

CREATE TRIGGER [dbo].[insMARA_Changelog] ON [dbo].[MARA]
FOR INSERT, UPDATE
AS

DECLARE @TimeStamp datetime

Set @TimeStamp = GetDate()

INSERT INTO MaraChange_log
(all fields here)
SELECT
fields here from mara table
FROM inserted ins JOIN mara na ON
na.maraprimarykeyID = ins.maraprimarykeyID

Can someone please provide details how to use table based triggers on insert on update on a table record to create a copy of that row to a change log table.

Thanks a lot for the helpful info.