SSMS cannot connect: error 40 could not open a connection to SQL Server
Resolved SQL
GM
Grace Mitchell
November 21, 2026
4 replies
112 views
Reviewed by moderators
3 participants

SSMS says A network related or instance specific error occurred, error 40, could not open a connection to SQL Server. How do I fix it?

Accepted answer
Marked as the solution to this question

This error means the client cannot reach the instance. Check:

1. The SQL Server service is started, in Services or SQL Server Configuration Manager.
2. The server name and instance name are correct, for example SERVER\SQLEXPRESS.
3. TCP/IP is enabled in SQL Server Configuration Manager under Network Configuration, then restart the service.
4. The firewall allows the port, usually 1433 for the default instance, and the SQL Browser service for named instances.
5. Remote connections are allowed in the server properties.

Try connecting with the computer name or IP and the port to find which step fails.

TCP/IP was disabled. Enabled it and restarted. Connects now.

Good. Keep the firewall rule limited to the networks that need access.

Yes.