#217 Triggers for Audit module

2.6
open
nobody
Usability (41)
5
2011-09-27
2011-09-27
Anonymous
No

We use a customised OrangeHRM and often insert/update/delete records via MS SQL Server Management Studio using a linked server to the OrangeHRM MySQL DB, with Openquery statements. This worked without a problem until we added the audit module to OrangeHRM - inserts would fail because the @userid field was not specifed. Since all back-end maintenance would be performed by the 'admin' users, we simply modified each of the triggers used by the admin module to include the line:

SET @orange_user = IFNULL(@orange_user, 'USR001');

As stated, we have made this change to our system, but this may be a useful addition for any other organisations wishing to manipulate the database via a linked server.

Discussion