Unix Technical Forum

function and linked server

This is a discussion on function and linked server within the SQL Server forums, part of the Microsoft SQL Server category; --> I have my own function, which I can use: declare @dt as datetime select @dt='20040121 12:22:33' select * from ...


Go Back   Unix Technical Forum > Database Server Software > Microsoft SQL Server > SQL Server

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-28-2008, 07:42 PM
Marek Wierzbicki
 
Posts: n/a
Default function and linked server

I have my own function, which I can use:

declare @dt as datetime
select @dt='20040121 12:22:33'
select * from index_gold_iif(@dt)

When I try do it from linked serwer:

declare @dt as datetime
select @dt='20040121 12:22:33'select * from
lewiatan.e_.dbo.index_gold_iif(@dt)

I have massage:
Server: Msg 170, Level 15, State 31, Line 2
Line 4: Incorrect syntax near '('.

Did server can't see function from linked server? Is it true or I have done
some error (what)?

Marek

PS. all done as "sa" user, linked server linked with sa account



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-28-2008, 07:42 PM
Simon Hayes
 
Posts: n/a
Default Re: function and linked server


"Marek Wierzbicki" <marek.wierzbicki.___@azymut.pl> wrote in message
news:bv39u8$g4g$1@news2.ipartners.pl...
> I have my own function, which I can use:
>
> declare @dt as datetime
> select @dt='20040121 12:22:33'
> select * from index_gold_iif(@dt)
>
> When I try do it from linked serwer:
>
> declare @dt as datetime
> select @dt='20040121 12:22:33'select * from
> lewiatan.e_.dbo.index_gold_iif(@dt)
>
> I have massage:
> Server: Msg 170, Level 15, State 31, Line 2
> Line 4: Incorrect syntax near '('.
>
> Did server can't see function from linked server? Is it true or I have

done
> some error (what)?
>
> Marek
>
> PS. all done as "sa" user, linked server linked with sa account
>
>
>


UDFs aren't supported directly on linked servers, but you can use
OPENQUERY() as a workaround:

http://support.microsoft.com/default...;en-us;Q319138

Simon


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-28-2008, 07:43 PM
Marek Wierzbicki
 
Posts: n/a
Default Re: function and linked server

> > declare @dt as datetime
> > select @dt='20040121 12:22:33'
> > select * from index_gold_iif(@dt)


> UDFs aren't supported directly on linked servers, but you can use
> OPENQUERY() as a workaround:
>
> http://support.microsoft.com/default...;en-us;Q319138


both of them isn't good, beacouse my function return table (there is "view
with parametr")

Marek



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-28-2008, 07:43 PM
Marek Wierzbicki
 
Posts: n/a
Default Re: function and linked server

> > UDFs aren't supported directly on linked servers, but you can use
> > OPENQUERY() as a workaround:
> >
> > http://support.microsoft.com/default...;en-us;Q319138


OK works for function returned table

Marek



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 12:44 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com