Sql-server – Disabled SA user is listed as logged in

permissionssasql server

I was looking for the last time users have been logged into the system and saw SA as being used. Strange is that SA is disabled by default and not used on our systems. How is that possible, what am I missing?

Here is the code used to list users:

SELECT login_name [Login] , MAX(login_time) AS [Last Login Time]
FROM sys.dm_exec_sessions
GROUP BY login_name;

And here is the SA listed as disabled and as logged in:

enter image description here

Thanks.

Best Answer

This is because some "system" session are showing "sa" as the username.

I think you can add a

where is_user_process = 1

in your query to exclude those system session and you should no longer see "sa" as a connected user.