Sunday, 2 August 2020

[Windows, SQL Server] How to verify the listening port of SQL Server on the local machine?

How to verify the listening port of SQL Server on the local machine?

Situation

You have already configured TCP/IP listening port for SQL Server from SQL Server Configuration Manager.


But if you want to make sure that the port is opened and the server listens to the port, then what should you do?

Before you start, if you want to verify the SQL Server port is opened from the client computer, then take a look here.

Traditional command prompt

In a traditional command prompt, you can use "netstat" command.
netstat -a -b | findstr <port number>

e.g. SQL Server Service port is "1433".


PowerShell Command

You can use "Get-Process" cmdlet  + "Get-NetTCPConnection" cmdlet.
Get-Process -Id (Get-NetTCPConnection -LocalPort <port number>).OwningProcess

e.g. SQL Server Service port is "1433".


PowerShell looks way much better.


References

Windows command prompt

Windows PowerShell Cmtlet










No comments:

Post a Comment

(KOR)☁️ AWS Solutions Architect Associate 자격증 취득 여정

  !저의 경험 , 팁 , 그리고 SAA-C03 자격증 합격을 위한 노하우 공유! 조금 늦은 포스팅이지만 , 꼭 공유하고 싶었던 이야기입니다 . 회사 내 주변 동료들이 자주 이렇게 말하곤 했습니다 . “ 님 실...