[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 323
  • Last Modified:

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.
0
npawlowski
Asked:
npawlowski
  • 2
1 Solution
 
Éric MoreauSenior .Net ConsultantCommented:
you can add "Application Name=YourAppName" to your application's connection string and it will reflect in SQL
0
 
npawlowskiAuthor Commented:
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?
0
 
Éric MoreauSenior .Net ConsultantCommented:
no it only means that this property has not been set (it is the default value)
0

Featured Post

[Webinar] Kill tickets & tabs using PowerShell

Are you tired of cycling through the same browser tabs everyday to close the same repetitive tickets? In this webinar JumpCloud will show how you can leverage RESTful APIs to build your own PowerShell modules to kill tickets & tabs using the PowerShell command Invoke-RestMethod.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now