[출처] http://www.mssqltips.com/sqlservertip/2495/identify-sql-server-tcp-ip-port-being-used/
set nocount on
DECLARE @test varchar(20), @key varchar(100)
if charindex('\',@@servername,0) <>0
begin
set @key = 'SOFTWARE\MICROSOFT\Microsoft SQL Server\'+@@servicename+'\MSSQLServer\Supersocketnetlib\TCP'
end
else
begin
set @key = 'SOFTWARE\MICROSOFT\MSSQLServer\MSSQLServer\Supersocketnetlib\TCP'
end
EXEC master..xp_regread @rootkey='HKEY_LOCAL_MACHINE',@key=@key,@value_name='Tcpport',@value=@test OUTPUT
SELECT 'Server Name: '+@@servername + ' Port Number:'+convert(varchar(10),@test)
[샘플]
set nocount on
DECLARE @test varchar(20), @key varchar(100), @servername varchar(255)
set @key = 'SOFTWARE\MICROSOFT\Microsoft SQL Server\MSSQL11.TEST6\MSSQLServer\Supersocketnetlib\TCP\IPAll'
EXEC master..xp_regread @rootkey='HKEY_LOCAL_MACHINE',@key=@key,@value_name='TcpDynamicPorts',@value=@test OUTPUT
SELECT convert(varchar(10),@test)
'mssql' 카테고리의 다른 글
mssql db name rule / 암호 복잡성 (0) | 2013.05.07 |
---|---|
mssql 메모리 제한 설정 (0) | 2013.04.30 |
mssql tcp 동적 포트 확인 방법 (0) | 2013.04.30 |
mssql 무인, 자동 설치 (0) | 2013.04.30 |
윈도우즈 방화벽 인바운드규칙 자동등록 (0) | 2013.04.30 |
댓글