Error occured while establishing a connection to the SQL server

Recently, in one of our applications, while trying to configure reporting services configuration we were getting the below error while trying to connect to a SQL database.

https://exchangequery.files.wordpress.com/2016/03/img2.jpg?w=600

Checked the remote server connections for the database and it was enabled.

https://exchangequery.files.wordpress.com/2016/03/sql4.png?w=600

Went into the component services and checked the local DTC connection.

 

https://exchangequery.files.wordpress.com/2016/03/test3331.png?w=600

Network DTC access was disabled and hence the issue.

https://exchangequery.files.wordpress.com/2016/03/img-1.jpg?w=891

Enabled them and after MS DTC service restart checked UDL connection for the affected database on that instance.

https://exchangequery.files.wordpress.com/2016/03/final.png?w=600

In addition to the above, we can also check the execution account permission on the SQL database server.

This can also happen if the SQL service state is not running.

Make sure SQL Server service status is Running. Also, make sure the TCP/IP communication is enabled on the SQL Server Configuration Manager on the instance where the problematic DB exists.

https://exchangequery.files.wordpress.com/2016/03/final2.png?w=600

By default, SQL Server runs on port 1433. If the default port is changed then these new ports should be added to the firewall exceptions.

You can also check the connectivity to the SQL Server by the below commands:

netstat -ano| findstr 1433

You should get a successful TCP listening establishment on the SQL server IP address and on port 1433.

Hope this helps.