How to query remote linked server

  • I have linked a remote server successfully. Linked server name is "DATA2".

    Now I need to issue a sql query against the remote server.

    So I do this :

    select * from DATA2.DB_name.TableName

    Now I am getting the errors:

    Msg 208, Level 16, State 1, Line 1

    Invalid object name 'DATA2.DB_name.TableName'.

    What am I doing wrong?

  • You need the 4-part name. In your case it seems like the schema is missing.

    Assuming it's dbo, the query would look like

    select * from DATA2.DB_name.dbo.TableName



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • Yes. That worked. Thanks a lot!

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

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