If you have the SPID of the process in question (from using something like Activity Monitor or
sp_who2), then you can perform this query on the server:
WHERE session_id = (SPID);
replacing (SPID) with the actual SPID of your client process. Look at the
net_transport column, that will tell you which protocol that process is using to communicate with SQL Server. If all you are interested in is the protocol, just use
SELECT net_transport instead of
You could also filter your query by other columns, such as client_net_address which, for TCP connections, will be the IP address of your client machine. You could send this query via ADO.NET interfaces. SQL SMO might also have something.
Here's the MSDN reference page for sys.dm_exec_connections. Note that you will need VIEW SERVER STATE rights on the server to see more than just your current session.
You can also specify the transport protocol in the
server directive of your connection string using the following syntax:
server=tcp:mysqlinstance1 (for TCP/IP)
server=np:mysqlinstance1 (for named pipes)
server=np:\\mysqlinstance1\pipe\pipename (for a specific pipe)