SQL Server port number viewing method
Direct query:
<code class="sql">SELECT name AS 'Port Name', physical_network_address AS 'Port Number' FROM sys.dm_exec_connections WHERE session_id = @@SPID</code>
Use PowerShell:
<code class="powershell">Get-Service "MSSQL$<instance name>" | Select Name, CurrentState, Port</code>
Using SQL Server Management Studio (SSMS):
Other methods:
<code>netstat -ano | findstr "<process id>"</code>
The above is the detailed content of How to check the port number of sqlserver. For more information, please follow other related articles on the PHP Chinese website!