The manager asked me if I could record the last time the user logged on to our business database, because someone had previously modified the login password of the database sa user, so we need to record it. I checked the information. It seems that I cannot record who has logged on to the business database. I can only record who has logged on to SQLSERVER.
The manager asked me if I could record the last time the user logged on to our business database, because someone had previously modified the login password of the database sa user, so we need to record it. I checked the information. It seems that I cannot record who has logged on to the business database. I can only record who has logged on to SQLSERVER.
SQLSERVER records the logon time of the logged-on user
A while ago, the manager asked me if I could record the last time the user logged on to our business database, because someone had previously modified the database sa user.
So we need to record the logon password.
I checked the information. It seems that I cannot record who has logged on to the business database. I can only record who has logged on to SQLSERVER.
The database version is SQL2005, and the operating system is Windows 7.
The following is a script written by myself. My implementation principle is to use a trigger. The trigger is a logon trigger, which covers the entire server range and the Hong Kong virtual host. If someone has logged on to the Hong Kong Space, just use
The bcp Command records the logon information in the log file.
1. If a trigger already exists in the original database, delete it.
1 USE MASTERtrg_logon_attempttest on all SERVER4 GO, Hong Kong server