Search code examples
sqlsql-serverdatabasesql-server-2012linked-server

How do you pull data from a database to another one using a linked server?


I have a local server set up on my computer with a local database. I am trying to connect to a network server with a linked server (I'm having a lot of trouble with this) and then create tables and views in the local database from the data in the network database. I'm using Microsoft SQL Server Management Studio 2012.


Solution

  • Try something like :

    SELECT * from openquery(LINKED_SERVER_NAME,'SELECT * FROM TABLE') 
    

    If your linked server is well configured, you should be able to query the tables in the linked server using openquery.