SQL SERVER – Network Port Used

During the recent Comprehensive Database Performance Health Check, I got a question from a client if there is an easy way to figure out the Network port used by SQL Server. Of course, there is a simple and easier way to figure this out.

SQL SERVER - Network Port Used networkport-800x344

Here is the script you can run to figure out the TCP Port used by your SQL Server.

FROM sys.dm_tcp_listener_states
WHERE type_desc = 'TSQL'

When I ran the above script on my machine, I got the following response.

SQL SERVER - Network Port Used tcpport

It was very clear from my results that my SQL Server is running on the static standard port of 1434.

If I face any issue with the connections, I often use this simple script to figure out what port my SQL Server is using, and based on that I connect to SQL Server on that network port number.

Here are a few additional blog posts on the same subject:

If you have any questions, you can always reach out to me on Twitter.

Reference: Pinal Dave (https://blog.sqlauthority.com

Computer Network, SQL Scripts, SQL Server
Previous Post
SQL SERVER – Capturing INSERT Timestamp in Table
Next Post
SQL SERVER – Query Shortcuts

Related Posts

Leave a Reply