sql connections

  • I want to know whaich connections are using which driver / api to connect to my server.

    For instance I'm told one application is using ODBC which I am sure it is not.

    But how do you see ODBC, ADODB, OLEDB, ... from the server's prespective?

  • I'm not sure you can. I'm not sure it should matter from the server. The idea of the API is the server sees calls to it without worrying about clients.

    Does sys.dm_exec_sessions give you what you need?

    http://msdn.microsoft.com/en-us/library/ms176013.aspx

  • The easiest way to see that is through the dynamic management views. CLIENT_INTERFACE_NAME in SYS.DM_EXEC_SESSIONS

    SELECT s.session_id, s.host_name, s.program_name, s.client_interface_name, s.login_name, s.status AS session_status,

    db_name(er.database_id) AS database_name,

    er.status AS request_status, er.command, er.percent_complete,

    er.blocking_session_id,

    er.wait_type, er.wait_time / 1000.0 AS wait_sec, er.last_wait_type, er.wait_resource,

    er.transaction_id, er.open_transaction_count,

    er.cpu_time / 1000.0 AS cpu_sec, er.total_elapsed_time / 1000.0 AS total_elapsed_sec, er.start_time, er.reads, er.writes, er.logical_reads,

    er.sql_handle, er.plan_handle

    FROM sys.dm_exec_requests er

    INNER JOIN sys.dm_exec_sessions s ON er.session_id = s.session_id

    WHERE s.is_user_process = 1

    AND s.session_id <> @@SPID

  • Bingo!

    Client_Interface_Name from sys.dm_exec_sessions

    Here is a sample from the column:

    .Net SqlClient Data Provider

    OLEDB

    ODBC

    NULL

    ODBC

    .Net SqlClient Data Provider

    .Net SqlClient Data Provider

    Thanks.

Viewing 4 posts - 1 through 3 (of 3 total)

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