Avatar of npawlowski
npawlowski
Flag for United States of America asked on

Application Names

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

Avatar of undefined
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?
ASKER CERTIFIED SOLUTION
Éric Moreau

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes