Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12

SQL Server Port Number Identifier Expand / Collapse
Author
Message
Posted Tuesday, May 24, 2011 1:06 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Thursday, October 16, 2014 12:29 AM
Points: 230, Visits: 508
When I run on my instance (dynamic port) this gives null . Not much use

Following gives the port

declare @tcpport varchar(1000),@value varchar(250);set @tcpport = 'SOFTWARE\Microsoft\Microsoft SQL Server\' + @@servicename + '\MSSQLServer\SuperSocketNetLib\Tcp';EXEC master..xp_regread @rootkey = 'HKEY_LOCAL_MACHINE', @key = @tcpport, @value_name = 'tcpPort', @value = @value OUTPUT;select @value
Post #1113790
Posted Tuesday, May 24, 2011 1:32 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Monday, October 13, 2014 7:16 AM
Points: 1,159, Visits: 4,656
M A Srinivas (5/24/2011)
When I run on my instance (dynamic port) this gives null . Not much use

Following gives the port

declare @tcpport varchar(1000),@value varchar(250);set @tcpport = 'SOFTWARE\Microsoft\Microsoft SQL Server\' + @@servicename + '\MSSQLServer\SuperSocketNetLib\Tcp';EXEC master..xp_regread @rootkey = 'HKEY_LOCAL_MACHINE', @key = @tcpport, @value_name = 'tcpPort', @value = @value OUTPUT;select @value


Did you use the script for right version?

Have you given correct file paths. Also check the select @value


Try this

declare @tcpport varchar(1000),@value varchar(250);
set @tcpport = 'SOFTWARE\Microsoft\MSSQLServer\' + @@servicename + '\MSSQLServer\SuperSocketNetLib\Tcp';EXEC master..xp_regread @rootkey = 'HKEY_LOCAL_MACHINE', @key = @tcpport, @value_name = 'tcpPort', @value = @value OUTPUT;
select @value



Muthukkumaran Kaliyamoorthy

Helping SQL DBAs and Developers >>>SqlserverBlogForum
Post #1113797
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse