Two instances of SQL Server in the same domain cannot connect, and the reported error message is as follows:
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or is not accessible. Verify The instance name is correct and that SQL Server is configured to allow remote connections. (provider:named Pipes provider, error:40-could not open a connection to SQL Server) (. Net SqlClient Data Provider)
The cause of the error is that the remote server's firewall does not open port 1433
Port 1433 is used for remote connections and is the default port for SQL Server, and the SQL Server service uses two ports: TCP-1433, UDP-1434. 1433 of these are used for external service to SQL Server, and 1434 is used to return to the requestor which TCP/IP port the SQL Server uses.
Solution
Step1, open firewall,advanced Settings
Step2,new Inbound Rule, create a port with TCP port number 1433
Inbound rules explicitly defines a rule that allows or blocks access to the local server
Step3, view the inbound Rule created in firewall
Two instances of SQL Server in the same domain cannot connect