SQL query user details in the current session in my project

Copper Contributor

Hi, I have an asp.net core project with multiple users.

 

Is there a way to query the details of the logged-in user in the current session? 

 

 

1 Reply

Hi @khalev0725 -- The sys.dm_exec_sessions DMV provides session details.  Something like below.  Take care.

select * from sys.dm_exec_sessions where session_id = @@SPID