Tuesday, July 4, 2023

SQL Server Find out the session details comming through application

--Find out the session details comming through application

select getdate(),@@servername,DB_NAME(dbid) as DBName,program_name,client_net_address ,client_tcp_port,loginame as LoginName
from sys.sysprocesses sp
join
sys.dm_exec_connections ec
on ec.session_id=sp.spid
where program_name like '%JDBC%' 
GO