Fortunately, the
.NET SqlClient
(and other ODBC drivers as well) has a built-in solution. Your application’sconnection string
has quite a few parameters available to provide configuration and information, and one that seems to get overlooked isApplication Name
. This one does exactly what it says on the tin – it lets you specify a name that will be displayed to anyone looking for it in SQL Server, includingsp_whoisactive
. Anyplace you have the ability to write a connection string, you can use this. It costs you nothing!
You can also start getting fancy with resource governor as well, segmenting pools based on application name.