I have a function in [MHL1P].[x].dbo.udf_Admin_GetNameByID(t3.StaffID)
I want to execute this function from another server in a store procedure like this:
select [MHL1P].[x].dbo.udf_Admin_GetNameByID(StaffID)
from StaffIdTable
Is there a configuration in SQL server to execute functions cross servers?
Look at sp_addlinkedserver
Note that this is usually a bad idea, as certain things don’t work as well on linked servers (the query optimizer doesn’t have good information about statistics or indexes, for example).