I need to test the connectivity of SQL Server with my remote machine,
I have SQL server name not IP address.
How can I check this connectivity. How will I know on which port the communication enabled.
I need to test the connectivity of SQL Server with my remote machine,
I have SQL server name not IP address.
How can I check this connectivity. How will I know on which port the communication enabled.
3条答案
按热度按时间gg0vcinb1#
You need to try to connect, there is no way find on which port someone is listening without directly asking, hey, is there anyone on this port?
Here is the way to do so from C#:
vfwfrxfs2#
Well you must know on which port the Sql server services are listening on remote server. Default port is 1433. If you want to test if a port is open on a server or not then you can try Telnet ping.
open command prompt:
If it's open then a screen will go empty immediately or return an error.
vktxenjb3#
You need to know the IP address or host name of the server and the TCP port, too. The instance name alone won't help, as they are not advertised on the network. If you have the server's name or IP and the SQL Server instance name, you can simply try to connect using an
SqlConnection
with an appropriate connection string. If you can connect, everything's fine.