I need to find the last time a user accessed the database. I am new to SQL and rarely have to use it. Details would help or links to learn those details.
For MS SQL server logins are not automatically tracked but this can be easily enabled with the Common Criteria Compliance option.
From the link you would run this
sp_configure 'show advanced options', 1; GO RECONFIGURE; GO sp_configure 'common criteria compliance enabled', 1; GO RECONFIGURE WITH OVERRIDE; GO
Then restart the database and run the scripts here from Microsoft.
The logins can be accessed with this query
Select * from sys.dm_exec_sessions
You need elevated permissions (View Server State or higher) to query this table.