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...