I am trying to correlate SQL query activity in a SQL Server Studio profile trace with different client processes in a large application that I am new to. The connection ApplicationName column in the trace window is set to ".Net SQLClient Data Provider" for all profiled query activity.
I would like to override the ApplicationName property on each new NHibernate command or connection with more meaningful internal application names associated with the main processes of the large application.
I have set a custom ApplicationName before but is it possible with NHibernate?
the first method I found was to use the connection-string (see links), but that is per connection and not per command and you won't know when .Net/NHibernate/Connection-Pooling/... decides to make a new connection.
Change Application Name in Sql Server Profiler
I am trying to find an T-SQL-Command to change/set this value from within a connection, but wasn't lucky till now.
Greetings
Juy Juka