Identify the port that sql server is running on

Identify the port that SQL Server is running on:

DECLARE @tcp_port nvarchar(5)

EXEC xp_regread
@rootkey    =    ‘HKEY_LOCAL_MACHINE’,
@key        =    ‘SOFTWAREMICROSOFTMSSQLSERVERMSSQLSERVERSUPERSOCKETNETLIBTCP’,
@value_name    =    ‘TcpPort’,
@value        =    @tcp_port OUTPUT

select @tcp_port

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s