SQL Named Instance Port Number

Heads up, you probably know the default port for SQL is 1433 but did you know the port is different for a named instance? And this port is dynamically set when you install the server. You can see what it is by looking in the registry. The below registry path is for SQL2008.

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL10.(InstanceName)\MSSQLServer\SuperSocketNetLib\TCP\IPAll

There are more details in this article

And if you are using a named instance SQL server, don’t forget to adjust your connection string.

<add name=”MyConnString” connectionString=”Data Source=MyServerName, 51601; Initial Catalog=Northwind;user id=MyUserName;password=SecretPassword” providerName=”System.Data.SqlClient” />

Notice 51601 is the port number.

Advertisements

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s