SQL Server Connection Pool

Here are some scripts to help debug an error like

System.InvalidOperationException: Timeout expired.
The timeout period elapsed prior to obtaining a connection from the pool.  This may have occurred because all pooled connections were in use and max pool size was reached.

Sample SQL to see connections:

SELECT spid, uid=rtrim(loginame), Program_name=rtrim(Program_name),
dbname=db_name(dbid), status=rtrim(status) 
    FROM master.dbo.sysprocesses
    WHERE db_name(dbid) = 'DatabaseName'

Leave a thought