patternsqlMinor
Determine which SQL drivers an application uses to connect to SQL server
Viewed 0 times
connectapplicationserversqlusesdriversdeterminewhich
Problem
I want to find out what SQL driver a third-party application (or any application for that matter) uses to connect to a SQL Server instance in production. It can be tough to get a fast answer from a vendor and we need to know this so that we can enable TLS 1.2 communication.
I've been told that extended events can solve my problem. Thank you.
I've been told that extended events can solve my problem. Thank you.
Solution
The article mentioned is almost what you want, i think
If you join
If you join
sys.dm_exec_connections with sys.dm_exec_sessions, you get what you need from columns program_name and client_interface_name:SELECT c.connect_time
,s.login_time
,s.host_name
,s.login_name
,c.protocol_type
,driver_version = CASE SUBSTRING(CAST(c.protocol_version AS BINARY(4)), 1, 1)
WHEN 0x70
THEN 'SQL Server 7.0'
WHEN 0x71
THEN 'SQL Server 2000'
WHEN 0x72
THEN 'SQL Server 2005'
WHEN 0x73
THEN 'SQL Server 2008'
WHEN 0x74
THEN 'SQL Server 2012+'
ELSE 'Unknown driver'
END
,s.program_name
,s.client_interface_name
,s.is_user_process
FROM sys.dm_exec_connections AS c
JOIN sys.dm_exec_sessions AS s ON c.session_id = s.session_idCode Snippets
SELECT c.connect_time
,s.login_time
,s.host_name
,s.login_name
,c.protocol_type
,driver_version = CASE SUBSTRING(CAST(c.protocol_version AS BINARY(4)), 1, 1)
WHEN 0x70
THEN 'SQL Server 7.0'
WHEN 0x71
THEN 'SQL Server 2000'
WHEN 0x72
THEN 'SQL Server 2005'
WHEN 0x73
THEN 'SQL Server 2008'
WHEN 0x74
THEN 'SQL Server 2012+'
ELSE 'Unknown driver'
END
,s.program_name
,s.client_interface_name
,s.is_user_process
FROM sys.dm_exec_connections AS c
JOIN sys.dm_exec_sessions AS s ON c.session_id = s.session_idContext
StackExchange Database Administrators Q#202458, answer score: 3
Revisions (0)
No revisions yet.