DECLARE @SqlServerName VARCHAR(255)
, @SqlVersion VARCHAR(255)
, @PortNumber VARCHAR(10)
DECLARE @Result TABLE(ServerName VARCHAR(255), Version VARCHAR(255), Port VARCHAR(10))
SELECT @SqlServerName = @@ServerName, @SqlVersion = LEFT(@@Version, 38)
EXEC xp_regread
@rootkey = 'HKEY_LOCAL_MACHINE',
@key = 'SOFTWARE\MICROSOFT\MSSQLSERVER\MSSQLSERVER\SUPERSOCKETNETLIB\TCP',
@value_name = 'TcpPort',
@value = @PortNumber output
Select @PortNumber,@SqlServerName ,@SqlVersion
, @SqlVersion VARCHAR(255)
, @PortNumber VARCHAR(10)
DECLARE @Result TABLE(ServerName VARCHAR(255), Version VARCHAR(255), Port VARCHAR(10))
SELECT @SqlServerName = @@ServerName, @SqlVersion = LEFT(@@Version, 38)
EXEC xp_regread
@rootkey = 'HKEY_LOCAL_MACHINE',
@key = 'SOFTWARE\MICROSOFT\MSSQLSERVER\MSSQLSERVER\SUPERSOCKETNETLIB\TCP',
@value_name = 'TcpPort',
@value = @PortNumber output
Select @PortNumber,@SqlServerName ,@SqlVersion
No comments:
Post a Comment