我正在尝试从远程sql Server中提取数据.我可以使用sql身份验证访问远程服务器;我没有使用与sp_addlinkedserver相同的凭据.
我正在尝试这样的事情:
Exec sp_dropserver 'Remote','droplogins' go EXEC sp_addlinkedserver @server='Remote',@srvproduct='',@provider='sqlNCLI',@datasrc='0.0.0.0' EXEC sp_addlinkedsrvlogin @useself='FALSE',@rmtsrvname='Remote',@rmtuser='User',@rmtpassword='Secret' Select Top 10 * from Remote.DatabaseName.dbo.TableName
这是我得到的:
OLE DB provider "sqlNCLI" for linked server "Remote" returned message "Login timeout expired". OLE DB provider "sqlNCLI" for linked server "Remote" 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].
再次,我可以使用这些确切的凭据直接访问服务器(在sql Management Studio中),因此我的网络或凭据不是问题.