Skip to main content
added 4 characters in body
Source Link
Aaron Bertrand
  • 181.5k
  • 28
  • 402
  • 619

You can spoof this in the application's connection string, or you can store override info elsewhere (like CONTEXT_INFO()) but, no, I don't believe there is any way to change what SQL Server shows in APP_NAME() (or the undocumented PROGRAM_NAME()) from inside SQL Server. Perhaps you could explain

Now that you've explained what you're really trying to do...

You can spoof this in the application's connection string, or you can store override info elsewhere (like CONTEXT_INFO()) but, no, I don't believe there is any way to change what SQL Server shows in APP_NAME() (or the undocumented PROGRAM_NAME()) from inside SQL Server. Perhaps you could explain what you're really trying to do.

You can spoof this in the application's connection string, or you can store override info elsewhere (like CONTEXT_INFO()) but, no, I don't believe there is any way to change what SQL Server shows in APP_NAME() (or the undocumented PROGRAM_NAME()) from inside SQL Server.

Now that you've explained what you're really trying to do...

added 241 characters in body
Source Link
Aaron Bertrand
  • 181.5k
  • 28
  • 402
  • 619

You can spoof this in the application's connection string, or you can store override info elsewhere (like CONTEXT_INFOCONTEXT_INFO()) but, no, I don't believe there is any way to change what SQL Server shows in APP_NAME() (or the undocumented APP_NAMEPROGRAM_NAME()) from inside SQL Server. Perhaps you could explain what you're really trying to do.

You can spoof this in the application's connection string, or you can store override info elsewhere (like CONTEXT_INFO) but, no, I don't believe there is any way to change what SQL Server shows in APP_NAME().

You can spoof this in the application's connection string, or you can store override info elsewhere (like CONTEXT_INFO()) but, no, I don't believe there is any way to change what SQL Server shows in APP_NAME() (or the undocumented PROGRAM_NAME()) from inside SQL Server. Perhaps you could explain what you're really trying to do.

Source Link
Aaron Bertrand
  • 181.5k
  • 28
  • 402
  • 619

You can spoof this in the application's connection string, or you can store override info elsewhere (like CONTEXT_INFO) but, no, I don't believe there is any way to change what SQL Server shows in APP_NAME().