Link to home
Start Free TrialLog in
Avatar of deschenesp
deschenesp

asked on

user-defined function & remote server

Hi all SQL SERVER Expert,

    I've made a user-defined function that works fine on the server, but if I want to use it from a remote server it does not work and I get this error.

Example :

 On the server that have the function this works good
     select * from dbo.func_Serveur_Alias()

 On another server that use a link server I tried this
     select * from suivi.applications.dbo.func_Serveur_Alias()

 And I get this error

Server : Msg 170, level 15, status 31, Line 1
Line 2: Incorrect syntax near '('.

PLEASE HELP ME !!!
Avatar of rafrancisco
rafrancisco

Try creating a view on your server that calls your user-defined function:

CREATE VIEW Serveur_Alias_View
AS
SELECT * FROM dbo.func_Serveur_Alias()

then from your remote server, use this view.

SELECT * FROM suivi.applications.dbo.Serveur_Alias_View
Avatar of deschenesp

ASKER

I Know that using a view with a remote server is posible, but this is not the way I want to do it. I want to be able to use my functions throught remote server. The reason is that I have more than 200 functions and dont want to recreate all of them in views.

How can I use my functions with a remote server ?
As far as I know, it is not possible to call a user-defined function from a remote server.
ASKER CERTIFIED SOLUTION
Avatar of rafrancisco
rafrancisco

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial