I Install SQL server in my system and I have to check on which port number SQL is working in my system
0yg35tkg1#
select distinct local_net_address, local_tcp_port from sys.dm_exec_connections where local_net_address is not null
The above query shows the local IP as well as the listening Port number
vfh0ocws2#
%windir%\System32\cliconfg.exe
yc0p9oo03#
You can also use this query
USE MASTER GO xp_readerrorlog 0, 1, N'Server is listening on' GO
Source : sqlauthority blog
yi0zb3m44#
Visually you can open "SQL Server Configuration Manager" and check properties of "Network Configuration":
7xllpg7q5#
This query works for me:
SELECT DISTINCT local_tcp_port FROM sys.dm_exec_connections WHERE local_tcp_port IS NOT NULL
yizd12fk6#
To check all the applications listening on all ports, there is command:
netstat -ntpl
w1e3prcc7#
PowerShell solution that shows all of the instances on the host as well as their incoming traffic addresses. The second bit might be helpful if all you know is the DNS:
ForEach ($SQL_Proc in Get-Process | Select-Object -Property ProcessName, Id | Where-Object {$_.ProcessName -like "*SQL*"}) { Get-NetTCPConnection | ` Where-Object {$_.OwningProcess -eq $SQL_Proc.id} | ` Select-Object -Property ` @{Label ="Process_Name";e={$SQL_Proc.ProcessName}}, ` @{Label ="Local_Address";e={$_.LocalAddress + ":" + $_.LocalPort }}, ` @{Label ="Remote_Address";e={$_.RemoteAddress + ":" + $_.RemotePort}}, State | ` Format-Table }
7条答案
按热度按时间0yg35tkg1#
select distinct local_net_address, local_tcp_port from sys.dm_exec_connections where local_net_address is not null
The above query shows the local IP as well as the listening Port number
vfh0ocws2#
%windir%\System32\cliconfg.exe
yc0p9oo03#
You can also use this query
USE MASTER GO xp_readerrorlog 0, 1, N'Server is listening on' GO
Source : sqlauthority blog
yi0zb3m44#
Visually you can open "SQL Server Configuration Manager" and check properties of "Network Configuration":
7xllpg7q5#
This query works for me:
yizd12fk6#
To check all the applications listening on all ports, there is command:
w1e3prcc7#
PowerShell solution that shows all of the instances on the host as well as their incoming traffic addresses. The second bit might be helpful if all you know is the DNS: