SQL Server port number viewing method
Direct query:
SELECT name AS 'Port Name', physical_network_address AS 'Port Number'
FROM sys.dm_exec_connections
WHERE session_id = @@SPID
Use PowerShell:
Get-Service "MSSQL$<instance name>" | Select Name, CurrentState, Port
Using SQL Server Management Studio (SSMS):
- Open SSMS and connect to the SQL Server instance.
- In Object Explorer, expand "Server Name" > "Connections".
- Right-click "TCP/IP" and select "Properties".
- On the "IP Address" tab, find the "TCP Port" field.
Other methods:
<code>netstat -ano | findstr "<process id>"</process></code>
- View SQL Server Configuration Manager:
- Open SQL Server Configuration Manager.
- Expand "SQL Server Network Configuration" > "Protocols for".
- Find the protocol you want to view the port number for, then right-click and select "Properties".
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!
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn