Querying a linked sql server

后端 未结 7 1813
醉话见心
醉话见心 2020-12-08 20:08

I added a linked server, which is showing in the linked server list, but when I query it, it throws an error with the db server name.

EXEC sp_helpserver
EXE         


        
7条回答
  •  臣服心动
    2020-12-08 20:47

    The accepted answer works for me.

    Also, in MSSQLMS, you can browse the tree in the Object Explorer to the table you want to query.

    [Server] -> Server Objects -> Linked Servers -> [Linked server] -> Catalogs -> [Database] -> [table]

    then Right click, Script Table as, SELECT To, New Query Window

    And the query will be generated for you with the right FROM, which you can use in your JOIN

提交回复
热议问题