Home > Common Problem > body text

How to check the sqlserver port number

下次还敢
Release: 2024-04-05 21:21:17
Original
935 people have browsed it

There are two ways to query the SQL Server port number: Use SQL Server Configuration Manager to view the "Port" field of the "TCP/IP" protocol. Use a T-SQL statement to execute SELECT net_transport, local_tcp_port FROM sys.dm_exec_connections WHERE session_id = @@SPID and then check the "local_tcp_port" field. The default port number is 1433, but other port numbers can be configured if necessary.

How to check the sqlserver port number

SQL Server port number query

How to query the SQL Server port number?

There are two ways to query the SQL Server port number:

Method 1: Use SQL Server Configuration Manager

  1. Open SQL Server Configuration Manager.
  2. Expand "SQL Server Network Configuration".
  3. Click "Protocol for [instance_name]".
  4. In the right pane, find the "TCP/IP" protocol, and then view the "Port" field.

Method 2: Use T-SQL statement

  1. Open SQL Server Management Studio.
  2. Connect to a SQL Server instance.
  3. Execute the following T-SQL statement:
<code class="sql">SELECT net_transport, local_tcp_port
FROM sys.dm_exec_connections
WHERE session_id = @@SPID;</code>
Copy after login
  1. In the results, find the row for the "net_transport" column with the value "TCP" and view "local_tcp_port" field.

Other notes:

  • Typically, the default port number of SQL Server is 1433.
  • In some cases, it may be necessary to configure other port numbers, such as if there are restrictions in firewalls or other network settings.
  • For SQL Server Express edition, the port number may be different.

The above is the detailed content of How to check the sqlserver port number. 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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!