无法连接到主服务器或目标服务器

无法连接到主服务器或目标服务器

本文介绍了SSDT无法发布:“无法连接到主服务器或目标服务器"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用SSDT将其发布到Azure中的SQL Server数据库.这样做时,我看到以下错误:

I'm attempting to use SSDT to publish to a SQL Server database in Azure. When I do so, I am seeing the following error:

忽略错误中将数据库名称作为服务器名称列出的事实,我不确定如何解决它.指定目标数据库后,就可以成功测试连接.我还可以使用相同的凭据通过SSMS连接数据库.

Ignoring the fact that it's listing a database name as the server name in the error, I'm not sure how to resolve it. When I specify the target database, I can successfully Test Connection. I can also connect using the same creds to the database through SSMS.

研究出错误之后,似乎Azure中数据库的防火墙通常不包括您要从中发布计算机的IP地址.它不仅包含我的IP,而且还添加了另一个防火墙规则,以允许每个IP(0.0.0.0-255.255.255.255)消除引起问题的防火墙.

After researching the error, it seems like it is often that the firewall for the database in Azure does not include the IP address of the machine you're publishing from. It not only contains my IP, but I added another firewall rule to allow every IP (0.0.0.0-255.255.255.255) to eliminate the firewall as a potential cause of the problem.

有什么想法吗?

推荐答案

这是一个已知问题.发生这种情况是由于新创建的SQL Azure数据库具有新的兼容性级别140. 进行更新从此处的SSDT最新版本可以解决此问题.

This is a known issue. This happens due to the new compatibility level 140 for newly created SQL Azure databases. The issue has been documented here and updating SSDT from here to the latest version may solve the issue.

或者,您可以将数据库的兼容性级别更改为130.

Alternatively, you can change the compatibility level of your database to 130.

ALTER DATABASE database_name
SET COMPATIBILITY_LEVEL =  130;

希望这会有所帮助.

这篇关于SSDT无法发布:“无法连接到主服务器或目标服务器"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-11 08:58