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.
Aaron Bertrand
- 181.5k
- 28
- 402
- 619