|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Tuesday, May 21, 2013 5:19 AM
Points: 228,
Visits: 472
|
|
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
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Tuesday, May 21, 2013 5:22 AM
Points: 1,123,
Visits: 4,423
|
|
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
|
|
|
|