如何在没有软件的情况下 ping/测试与 SQL Server 的连接(例如通过 cmd)?

DMX*_*nal 20 sql-server cmd ping

有没有办法通过命令行或无需任何额外软件来测试与 SQL Server 的连接?我尝试了本文中所示的 ping 和 telnet 方法,但它们都无法找到我的 SQL Server。请注意,连接正常,我可以通过 SSMS 连接到服务器,但能够以其他方式排除连接故障会很有用。

例如,我们有人在家工作,我希望能够测试与数据库服务器的连接,而无需在他们的计算机上安装 SSMS。

服务器名称如下所示:SERVER\SQLEXPRESS

我尝试了ping SERVER\SQLEXPRESS(Ping 请求找不到主机)和telnet SERVER 1433(无法在端口 1433 上打开与主机的连接)

编辑:我可以很好地 ping 服务器ping SERVER

EDIT2:我尝试过的所有内容都使用名称和IP进行测试。DNS 很好,因此使用其中之一不会导致问题

Bee*_*iii 26

..it would be useful to be able to troubleshoot the connection otherwise.

For example, we have people working from home and I want to be able to test the connection to the database server without having to install SSMS on their machine.

Assuming your users are using windows you could send them a udl file.

If you create a blank text document and save it with the extension udl instead of txt. You can then double click the file. Below is an example of one I created on my desktop.

UDL文件

Opening that file in windows will give you the following prompt and allow you to test connection.

UDL 提示

You can do this yourself and send it to the user or walk them through it. I use it quite often when testing connectivity on boxes that don't have SSMS installed and it gives the added bonus of providing proper error messages.