Stored Procedures

Snippets

17

When running a named instance of MS SQL the instance will run on a port other than the usual port 1433. To determine the port you can use the following query:

DECLARE @tcp_port nvarchar(5)

EXEC xp_regread
@rootkey    =    'HKEY_LOCAL_MACHINE',
@key        =    'SOFTWARE\MICROSOFT\Microsoft SQL Server\MSSQL\MSSQLSERVER\SUPERSOCKETNETLIB\TCP',
@value_name    =    'TcpPort',
@value        =    @tcp_port OUTPUT

select @tcp_port

In my case the instance was named "MSSQL".

Comments

There are currently no comments, be the first to post one!

Post Comment

Only registered users may post comments.