Hi everybody! I need to get the application names that map to our SQL databases. I can get a lot of information using sys.sysprocesses and the connections/sessions DMVs, but the program name will be .Net SqlClient Data Provider, which doesn't tell me the specific app name. I can select app_name() to retrieve the current application, which gives me the info I want, but I want it for all processes. I'd obviously like to do this in T-SQL but am open to capturing this using VB. Any help would be most appreciated.
Microsoft SQL Server
Last Comment
Éric Moreau
8/22/2022 - Mon
Éric Moreau
you can add "Application Name=YourAppName" to your application's connection string and it will reflect in SQL
npawlowski
ASKER
So, when I see .Net Sql Client Data Provider in the sys.sysprocesses.program_name field, it's because the "Application Name=YourAppName" was never added to the connection string? This means that the app team is going to have to do this for all of the apps?