Forum Discussion
khalev0725
Sep 29, 2022Copper Contributor
SQL query user details in the current session in my project
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?
bake13
Microsoft
Sep 29, 2022Hi 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