Anyone any idea how to capture the user logged into the manager program. I have written some triggers creating log tables for various actions and it would be really good to be able to record the user at the time.
Capture Manager Login
May 04, 2006
1 Replies
Hi David, I wrote an Update trigger on the cashier table in our DB that writes information to a custom table whenever someone enters incorrect info and the login fails. The name of my custom table is c_CaptureFailedLogons. Here's the trigger:
CREATE TRIGGER tr_LoginAttempt ON Cashier FOR UPDATE AS IF @@ROWCOUNT 1 RETURN
IF (SELECT FailedLogonAttempts FROM INSERTED) > 0 BEGIN DECLARE @Cashier INT SELECT @Cashier = Number FROM INSERTED INSERT INTO c_CaptureFailedLogons (CashierID, ClientComputerName, Time) VALUES (@Cashier, Host_Name(), GetDate()) END
My trigger only inserts data into my custom table if the number in the FailedLogonAttempts column of the cashier table is incremented up by one, or in other words if the logon fails. The column value is set to zero everytime there is a successful logon so you could remove this if statement in my trigger and it could be set up to write info to a table for you every time a user logs in. In my case I have it capture the cashier id logging in, the name of the computer they are accessing RMS from, and the time. Let me know if you have any questions.
hth kevin
"David" wrote:
Join the Discussion
Have something to add? Share your thoughts — no account required.
Didn't find your answer?
Ask the community — no account required