Using UDF in linked server from view

  • Hi

    I have a view below:

    SELECT TOP (100) PERCENT TimeStamp, Field1

    FROM

    Linked_Server.Database.dbo.MyTable

    WHERE (Field1 = 'Blah') AND

    (Linked_Server.Database.dbo.MyUDF([Param1], [Param2]) = 1)

    When saving the view i get the following error:

    'Remote function reference Linked_Server.Database.dbo.MyUDF is not allowed, and the column name Linked_Server could not be found or is ambiguous'

    I know it can see the Linked_Server as i'm using it in other views.

    Any thoughts?

    Thanks

    Paul

  • This was removed by the editor as SPAM

  • Just had a quick look at Openquery thanks.

    So is the following the correct syntax for using a UDF from linked server in where clause.

    SELECT TOP (100) PERCENT TimeStamp, Field1

    FROM

    Linked_Server.Database.dbo.MyTable

    WHERE (Field1 = 'Blah') AND

    (SELECT * FROM OPENQUERY(Linked_Server,'MyUDF([Param1], [Param2])' = 1)

    Sorry can't connect to my dev machine at the moment to check syntax.

    Thanks again

    Paul

  • This was removed by the editor as SPAM

  • Thanks I'll give that a try.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply