[Part 2] Cannot connect to Server A network-related or instance-specific error occurred while establishing a connection to SQL Server

Hi SQL Server Folks,

In the Part-1 of this section I told you that how to open the default SQL Server applications ports of SQL Server 2008 R2 on Windows Server 2008 R2. But what happen if SQL Server applications is not using default ports which happened most probably. So to open the ports that SQL Server apps is using first we need to find out the port numbers. To find out the port numbers that is using by different SQL Server applications like SQL Server, Analysis Service and SQL Server Browser Service, Open the command prompt as Administrator and type the following command:-

  1.  “netstat –abn >>C:\Port.txt”

2.  This command will capture all the ports and their respective PID (Process ID) i.e. which PID is using which port in your system. All this info you can find in a file name as Port.txt under C: drive that we just created.

3. To find out the PID for various SQL applications go in to start –> Programs –>Microsoft SQL Server 2008 R2 –> Configuration Tools –> SQL Server Configuration Manager then you will find window like below:-


4. On this window on the left hand side you can see “SQL Server Services”, Just click on that and you will see a window like below:-

In this window as you can see in highlighted section that there are different SQL Applications are there under column “Name” and they are using different “Process ID”.

5. Now you open the file “Port.txt” and search the PID for which you want to know the Port No. For ex. If you want to find out that What is the port using by Analysis Services then note down the PID for this Analysis Service that is 4260 in this case, it might be different in your case. Now Search that PID 4260 in the ports.txt file you will get a info like below:-

AS highlighted this PID using; Here is the IP which is used by  Analysis Service and 2383 is the port number where Analysis Service is listening the client requests. 

Like that you can find out other port numbers used by different applications.

Hope It will Help Someone !! Thanks for your time to read this.

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

%d bloggers like this: