The port number of the SQL Server database can be queried through the following steps: connect to the database server and execute the query SELECT @@SERVERPORT; run the query, and the port number is displayed in the result grid.
SQL Server database port number query method
Query method:
Query the port number of the SQL Server database through the following steps:
Step 1: Connect to the database server
Step 2: Execute the query
<code class="sql">SELECT @@SERVERPORT;</code>
Step 3: Run the query
Query results:
The query will return the port number of the current database server. You will see the port number in the results grid.
Other methods:
In addition to using SSMS query, there are other methods to find the port number of the SQL Server database:
netstat -an
and then look for the port with the SQL Server process. <code>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.<InstanceName>\MSSQLServer</code>
where <InstanceName>
is The name of the SQL Server instance.
Please note that the default SQL Server port number is 1433, but it can be configured to a different value.
The above is the detailed content of How to check the sqlserver database port number. For more information, please follow other related articles on the PHP Chinese website!