Home > Common Problem > How to check the port number of sqlserver

How to check the port number of sqlserver

下次还敢
Release: 2024-04-05 22:12:19
Original
1285 people have browsed it

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>
Copy after login

Use PowerShell:

<code class="powershell">Get-Service "MSSQL$<instance name>" | Select Name, CurrentState, Port</code>
Copy after login

Using SQL Server Management Studio (SSMS):

  1. Open SSMS and connect to the SQL Server instance.
  2. In Object Explorer, expand "Server Name" > "Connections".
  3. Right-click "TCP/IP" and select "Properties".
  4. On the "IP Address" tab, find the "TCP Port" field.

Other methods:

  • Use netstat command:
<code>netstat -ano | findstr "<process id>"</code>
Copy after login
  • View SQL Server Configuration Manager:
  1. Open SQL Server Configuration Manager.
  2. Expand "SQL Server Network Configuration" > "Protocols for".
  3. 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!

Related labels:
source:php.cn
Statement of this Website
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
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template