March 01, 2006, 02:27 AM
QalqiliMaintain Module issue
hi All
i have some issue at the Maintain Procedure:
i Create the Maintain Application that update this table in SQLServer Database
{First Name , Last Name , Account Number , TransAction Time , TransAction User} by Inserting new record contain only the {First Name , Last Name , Account Number}
my quistion here i want to set the TransAction Time to the Time Of the Server and the TransAction User to the User whoes logged into the Dashboard ?
any suggestion
March 01, 2006, 03:09 AM
PeteHey Q,
I work oracle not with Sqlserver , but the way i go about is , that i create a update trigger for the DB table , this has the advantage that you dont have to fill in the user and date in maintain , because you can define that in your database trigger
I'm almost sure that you can DB triggers in sqlserver also.
Peter
March 01, 2006, 03:22 AM
Petei've googled this up for you
CREATE TRIGGER myTRIGGER on THETABLE
INSTEAD OF UPDATE
AS
UPDATE THETABLE
SET
DT = GETDATE(),
NM = COALESCE(inserted.NM, USER)
FROM inserted
WHERE THETABLE.ID = inserted.ID
GO
something like this must work