Yes I read this How to find the port for MS SQL Server 2008?
no luck.
telnet 1433
returns connection failed, so I must specify other port.
I tried to use
netstat -abn
but I don't see sqlservr.exe or something similar on this list.
Why it so difficult to find that port? :/
SQL Server 2000 Programs | MS SQL Server | Client Network Utility | Select TCP_IP then Properties
SQL Server 2005 Programs | SQL Server | SQL Server Configuration Manager | Select Protocols for MSSQLSERVER or select Client Protocols and right click on TCP/IP
try once:-
More there: https://docs.microsoft.com/en-us/sql/relational-databases/system-dynamic-management-views/sys-dm-tcp-listener-states-transact-sql?view=sql-server-2017
Here is a quick PowerShell script (since no one has provided solution in PowerShell yet:))
Note: this must be executed at Server (either RDP or use PS Remoting), if ran correctly following will print exact port number:
You might need to tweak the code, works great for me.
HTH
If you have run "netstat -a -b -n" (from an elevated command prompt) and you don't see "sqlservr.exe" at all then either your SQL Server service is not running or its TCP/IP network library is disabled.
Run SQL Server Configuration Manager (Start | All Programs | Microsoft SQL Server 2008 | Configuration Tools).
Navigate to SQL Server Services. In the right-hand pane look for SQL Server (). Is it stopped? If so, start it.
Navigate to SQL Server Network Configuration (or SQL Server Network Configuration (32-bit) as appropriate) then Protocols for . In the right-hand pane look for "TCP/IP". Is it disabled? If so, enable it, then restart the SQL Server service.
Note that he Instance ID will be MSSQLSERVER for the default instance.
Please also note that you don't have to enable the TCP/IP network library to connect a client to the service. Clients can also connect through the Shared Memory network library (if the client is on the same machine) or the Named Pipes network library.
very simple. make a note of the sqlsrvr.exe PID from taskmanager then run this command:
it will show TCP and UDP connections of your SQL server (including ports) standard is 1433 for TCP and 1434 for UDP
example :