SQL Port:
Everyone knows about the default SQL port – 1433 but for security reasons most of us will change it to other number. We can check this either through Configuration Manager or Query Analyzer.
Following command will give you the port number in which the sql server is listening…..
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
EXEC xp_regread
@rootkey = 'HKEY_LOCAL_MACHINE',
@key = 'SOFTWARE\MICROSOFT\MSSQLSERVER\MSSQLSERVER\SUPERSOCKETNETLIB\TCP', @value_name = 'TcpPort',
@value = @tcp_port OUTPUT
select @tcp_port
No comments:
Post a Comment