954,593 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Can we call a User defined Function using Linked Servers ?

I cant call :
[111.111.111.1].Database.dbo.fn_test(@test) (Not working !)
but i can call :
Database.dbo.fn_test(@test)
why ?

and if no way to call this, can i populate in a function
a TABLE variable using a Stored Procedure to do this ?

CREATE FUNCTION fn_test(@idcode int,@idoper int)
RETURNS TABLE
AS
RETURN (EXEC [111.111.111.1].Database.dbo.sp_populate)
Not working !
Thanks for your help

aiosilver
Newbie Poster
1 post since Aug 2006
Reputation Points: 10
Solved Threads: 0
 

There might be permission violation.
Check the user associated with the Linked server and if he has sufficient privileges to access the UDF

sujendra
Newbie Poster
3 posts since Aug 2006
Reputation Points: 10
Solved Threads: 1
 

hey buddy,:lol:

first you need to add up the linked server

EXEC sp_addlinkedserver
@server = 'server1',
@srvproduct = '',
@provider = 'sqloledb',
@datasrc = 'LocalServer'

then
add linkedserverlogin

EXEC sp_addlinkedsrvlogin 'server1', 'true'

then write up the query as

[server1].Database.dbo.fn_test(@test).

reply me if u need further info.
Thanks,

Chaitanya.


:cool:

chmonalisa
Light Poster
26 posts since Sep 2006
Reputation Points: 11
Solved Threads: 1
 

I'm having a similar issue. I've defined the linked server and I can select from the remote tables, but I get an "invalid column name" error on the linked server name when I perform a function call from the linked server. Both servers are Enterprise Edition (64-bit) with build # 9.00.3042.00 (SP2). Any ideas? Thanks in advance... Dale

DVHSr
Newbie Poster
3 posts since May 2007
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You