Reputation: 399
I want to pull out data from different tables from different servers. I took a query at V5\SQL2014
Server and run these following to connect to V5_27\SQL2005
Server
EXEC sp_addlinkedserver
@server= 'V5_27\SQL2005',
@srvproduct='V5_27\SQL2005',
@provider='SQLNCLI',
@datasrc='tcp:0.0.0.0'
EXEC sp_addlinkedsrvlogin
@useself='FALSE',
@rmtsrvname='V5_27\SQL2005',
@rmtuser='sa',
@rmtpassword='123'
SELECT * FROM Stk006,[V5_27\SQL2005]..[TESTACC].Stk006
It shows me following errors.
OLE DB provider "SQLNCLI11" for linked server "V5_27\SQL2005" returned message "Login timeout expired".
OLE DB provider "SQLNCLI11" for linked server "V5_27\SQL2005" returned message "A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.".
Msg 10049, Level 16, State 1, Line 22 TCP Provider: The requested address is not valid in its context.
User and Password
are not wrong.Allow remote
is enabled in both servers.TCP/IP and Named Pipes
are enabled in both servers.Please help me, thanks!
Upvotes: 0
Views: 15571
Reputation: 399
Thanks everyone, I found a solution for my problem.
You can check the solution link here or do below steps.
Login with sa
and password
select
lc.t2 as 'Local Stock Code',
ext.t2 as 'External Stock Code'
from
Stk001 lc,
[V5_27\SQL2005].[TESTACC].[dbo].[STK001] ext
Upvotes: 1