Subscribe to RSS feed  Follow @jackvamvas - Twitter

*Use the Comments section for questions Links


SQL Server DBA Jobs

Tcp port is already in use.How do I check if a port is already in use?

20 February,2023 by Tom Collins

Question: SQL Server won't start , so checked Event Viewer and getting the following message. 

Server TCP provider failed to listen on [ 'any' <ipv4> 50010]. Tcp port is already in use.

How can I check if the port is already in use and which other process or service  has locked the port and therefore not allowing SQL Server to start on designated port ?


The  first thing to identify is the Owning process and check the Process Name . There are different methods to list the processes currently using (or not using) the port. 

I like using Powershell for investing Windows related issues . Here is a Powershell script that  will either return the : Local Address, Local Port ,Remote Address,Remote Port ,State ,Applied Setting , Owning Process 

or if there are no processes utilising the port - return a  message 

The TCP connections are returned by the Get-NetTCPConnection powershell cmdlet. 

$TcpPort = "50010"
$TcpConn = Get-NetTCPConnection | Where-Object {$_.LocalPort -eq $TcpPort -or $_.RemotePort -eq $TcpPort}
$process = $TcpConn | Select-Object OwningProcess -Unique
if ($process -ne $null)
    Get-Process | Where-Object {$ -eq $process.OwningProcess} | Select-Object Id, ProcessName
    write-output "No services\processes discovered using the port"

read more on ports 

How to find SQL Server tcp port with Powershell

How to find the local tcp port used on SQL Server

Change the port for sql server service broker

How to get SQL port number using xp_readererrorlog

How to configure SQL Server static port with Powershell

Author: Tom Collins (


Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.


Post a comment on Tcp port is already in use.How do I check if a port is already in use? | SQL Server Performance Tuning | SQL Server DBA:Everything | FAQ | Contact|Copyright & Disclaimer