如何在 SQL Server 连接字符串中指定端口号? [英] How to specify a port number in SQL Server connection string?
本文介绍了如何在 SQL Server 连接字符串中指定端口号?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在 SQL Server Management Studio 中使用以下连接字符串.连接失败:
I use the following connection string in SQL Server Management Studio. It failed to connect:
mycomputer.test.xxx.com:1234\myInstance1
但是下面一个是可以的:
But the following one is ok:
mycomputer.test.xxx.com\myInstance1
那么如何在连接字符串中指定端口号?
So how do I specify a port number in a connection string?
推荐答案
使用逗号指定 SQL Server 的端口号:
Use a comma to specify a port number with SQL Server:
mycomputer.test.xxx.com,1234
指定端口时不需要指定实例名称.
It's not necessary to specify an instance name when specifying the port.
http://www.connectionstrings.com/ 中有更多示例.它救了我好几次.
Lots more examples at http://www.connectionstrings.com/. It's saved me a few times.
这篇关于如何在 SQL Server 连接字符串中指定端口号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文