DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/)
-   MS SQL (http://www.daniweb.com/forums/forum127.html)
-   -   Can we call a User defined Function using Linked Servers ? (http://www.daniweb.com/forums/thread51696.html)

aiosilver Aug 3rd, 2006 2:51 pm
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

sujendra Aug 12th, 2006 6:46 pm
Re: Can we call a User defined Function using Linked Servers ?
 
There might be permission violation.
Check the user associated with the Linked server and if he has sufficient privileges to access the UDF

chmonalisa Sep 14th, 2006 6:48 am
Re: Can we call a User defined Function using Linked Servers ?
 
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:

DVHSr May 7th, 2007 3:23 pm
Re: Can we call a User defined Function using Linked Servers ?
 
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


All times are GMT -4. The time now is 8:30 am.

Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC