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.

Network patch panel with cables under the title Network Port Used

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

SELECT *
FROM sys.dm_tcp_listener_states
WHERE type_desc = 'TSQL'

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

Network port

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.

Published by Pinal Dave on SQLAuthority. More of my work at pinaldave.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

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.