Here is the script to find which port number is opend to connect SQL server. We all know 1433 is the default port number. Here i'm providing script that will help us to find which port is opend in the server.
---------
DECLARE @tcp_port nvarchar(5)
EXEC xp_regread
@rootkey = 'HKEY_LOCAL_MACHINE',
@key = 'SOFTWARE\MICROSOFT\MSSQLSERVER\MSSQLSERVER\SUPERSOCKETNETLIB\TCP',
@value_name = 'TcpPort',
@value = @tcp_port OUTPUT
select @tcp_port as SQLPORT
----------
We can also find using GUI base. for this go to start button> all programms > configuration manager > select protocols for MSSQLSERVER> right click on TCP/IP> go to properties. that's it. we will get TCP details as you can find in the below
---------
DECLARE @tcp_port nvarchar(5)
EXEC xp_regread
@rootkey = 'HKEY_LOCAL_MACHINE',
@key = 'SOFTWARE\MICROSOFT\MSSQLSERVER\MSSQLSERVER\SUPERSOCKETNETLIB\TCP',
@value_name = 'TcpPort',
@value = @tcp_port OUTPUT
select @tcp_port as SQLPORT
----------
We can also find using GUI base. for this go to start button> all programms > configuration manager > select protocols for MSSQLSERVER> right click on TCP/IP> go to properties. that's it. we will get TCP details as you can find in the below
Hope this will helps you too...
Post a Comment