syntax for querying from a different server

  • Can anyone help me with the syntax for the select statement :

     

    select

    f11.table1

    from

     dbo.table1 f11

    where

    f11.column2 > (select f11qa_column2

    from servername\instance.dbo.databasename.table1 f11qa

    where f11qa.column1 = f11.column1)

     

    The query editor complains about the \

  • Hello,

    You can't select the data from a named instance like "servername\instance". You need to create / have linked server, so that you can use like

    select yourcolumnname from linkedserver.dbo.databasename.table1

    Look for Books Online help "sp_addlinkedserver"

    Hope this helps.

    Thanks

     


    Lucky

Viewing 2 posts - 1 through 1 (of 1 total)

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