I want to use the HOST_NAME() system variable in a stored procedure to get the name of the machine from which the stored procedure is called. If I execute the stored procedure from SQL Mgmt Studio, it works as expected. The stored procedure returns the name of my workstation.
When the stored procedure is executed from a C++ program, HOST_NAME() returns spaces. Any idea as to why this would be happening?