Inactive SPID

  • I am trying to find the user name using SPID. This is not active SPID.Is there a way to find the user name based on the SPID?

  • Do you mean the session is sleeping or a session whose connection has already been closed?

    You can use the following script to find the login names of all connections:

    select session_id, login_name, status from sys.dm_exec_Sessions;

    Add a where clause with a status of sleeping, if required. If it's a session that's already closed, you can check the default trace file in the SQL Server directory but it doesn't contain much information:

    C:\Program Files\Microsoft SQL Server\instance_name\MSSQL\Log

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply