Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Unable to get the data from 2 tables which are in 2 differenet servers

Unable to get the data from 2 tables which are in 2 differenet servers

Scheduled Pinned Locked Moved Database
tutorialsharepointdatabasesysadmin
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    vnr
    wrote on last edited by
    #1

    Hi all, I am trying to get the data from 2 tables which are in 2 different servers , to get that i have used "sp_addlinkedserver" .Using this I am able to connect to the server also .I have used the following commands for example my server ip is 11.12.23.121 EXEC sp_addlinkedserver '11.12.23.121' EXEC sp_addlinkedsrvlogin @rmtsrvname = '11.12.23.121' after this I am not bale to get the results of the linked server using following query select * from '11.12.23.121'.testdb.dbo.userreg Please tell me how to get the data from the linked server. Thanks in advance

    M 1 Reply Last reply
    0
    • V vnr

      Hi all, I am trying to get the data from 2 tables which are in 2 different servers , to get that i have used "sp_addlinkedserver" .Using this I am able to connect to the server also .I have used the following commands for example my server ip is 11.12.23.121 EXEC sp_addlinkedserver '11.12.23.121' EXEC sp_addlinkedsrvlogin @rmtsrvname = '11.12.23.121' after this I am not bale to get the results of the linked server using following query select * from '11.12.23.121'.testdb.dbo.userreg Please tell me how to get the data from the linked server. Thanks in advance

      M Offline
      M Offline
      Mycroft Holmes
      wrote on last edited by
      #2

      Try the following

      select * from [11.12.23.121].testdb.dbo.userreg

      Never underestimate the power of human stupidity RAH

      V 1 Reply Last reply
      0
      • M Mycroft Holmes

        Try the following

        select * from [11.12.23.121].testdb.dbo.userreg

        Never underestimate the power of human stupidity RAH

        V Offline
        V Offline
        vnr
        wrote on last edited by
        #3

        HI, Thank for your reply , i have tried to get the data using the query but getting the following error "OLE DB provider "SQLNCLI" for linked server "[server]" returned message "Login timeout expired". OLE DB provider "SQLNCLI" for linked server "[server]" returned message "An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections.". Msg 53, Level 16, State 1, Line 0 Named Pipes Provider: Could not open a connection to SQL Server [53]. " can you please tell me the solution for this. Thank you

        M 1 Reply Last reply
        0
        • V vnr

          HI, Thank for your reply , i have tried to get the data using the query but getting the following error "OLE DB provider "SQLNCLI" for linked server "[server]" returned message "Login timeout expired". OLE DB provider "SQLNCLI" for linked server "[server]" returned message "An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections.". Msg 53, Level 16, State 1, Line 0 Named Pipes Provider: Could not open a connection to SQL Server [53]. " can you please tell me the solution for this. Thank you

          M Offline
          M Offline
          Mycroft Holmes
          wrote on last edited by
          #4

          When setting up the linked server you have not applied the correct credentials. When, under duress, we need to do this we use a SQL standard account between servers and set it up in SSMS when creating the linked server.

          Never underestimate the power of human stupidity RAH

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups