我有两个Sql Server数据库:
static IP
,以便从其他开发机器远程访问。计算机为deployed in Location A
且accessible from Location B or C
为geographically separated
。 要使用SSMS进行连接,请Location B or C
使用IP Address/UserName/Password
。 Neither instance name
需要nor FQDN
。只有IP。
我们在查询中使用链接服务器,但由于Azure不支持链接服务器,因此它们无法完全失败。因此,为了从azure db访问本地,我们使用外部/表和数据源,但仍然给我带来连接问题。
Msg 46823, Level 16, State 1, Line 1
Error retrieving data from XXX.XXX.157.236.TableBackup. The underlying error message received was: 'A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)'.
请帮我解决这个问题。
我正在使用外部表将Sql Azure连接到我的内部部署服务器。请参阅以下代码:
--CREATE MASTER KEY ENCRYPTION BY PASSWORD = '##########';
--Needs to be username and password to access SQL database
CREATE DATABASE SCOPED CREDENTIAL SqlUsercred WITH IDENTITY = '####user', SECRET = '########';
CREATE EXTERNAL DATA SOURCE Remote1801
WITH
(
TYPE=RDBMS,
LOCATION='XXX.XXX.157.236',
DATABASE_NAME='TableBackup',
CREDENTIAL= SqlUsercred
);
CREATE EXTERNAL TABLE oeordhExt(
[Entity] [varchar](14) NOT NULL,
[ordnumber] [char](22) NOT NULL,
[SHIPTO] [char](6) NOT NULL,
[SHPNAME] [char](60) NOT NULL,
[SHPADDR1] [char](60) NOT NULL,
[SHPADDR2] [char](60) NOT NULL,
[SHPADDR3] [char](60) NOT NULL,
[SHPADDR4] [char](60) NOT NULL,
[SHPCITY] [char](30) NOT NULL,
[SHPSTATE] [char](30) NOT NULL,
[SHPZIP] [char](20) NOT NULL,
[SHPCOUNTRY] [char](30) NOT NULL,
[SHPPHONE] [char](30) NOT NULL,
[SHPFAX] [char](30) NOT NULL,
[SHPCONTACT] [char](60) NOT NULL
)
WITH
(
DATA_SOURCE = Remote1801,
SCHEMA_NAME = 'dbo', --schema name of remote table
OBJECT_NAME = 'oeordh' --table name of remote table
);
select * from oeordhExt
`
消息46823,级别16,状态1,行53错误从中检索数据 180.150.157.236.TableBackup。收到的基本错误消息是:'发生与网络相关或特定于实例的错误 建立与SQL Server的连接。找不到服务器或 无法访问。验证实例名称是否正确 SQL Server配置为允许远程连接。 (提供者:命名 管道提供程序,错误:40 - 无法打开与SQL的连接 服务器)”