Additional SQL Server features and topics not covered by specific categories
Since this is on a laptop for local study, the most common cause is either:
- only SSMS was installed and no SQL Server instance is actually running, or
- the server name is incorrect.
Use this checklist:
- Verify that SQL Server is installed and running.
- SSMS is only the management tool. It does not include the SQL Server engine.
- Since SQL Server 2019 Express was installed, make sure its Database Engine service is running in SQL Server Configuration Manager or Windows Services.
- Try a local connection from the same laptop.
- In SSMS, select Database Engine.
- Use Windows Authentication.
- For Server name, try:
-
<computer name>for a default instance -
<computer name>\<instance name>for a named instance
-
- If Express was installed as a named instance, the instance name must be included.
- Confirm the exact instance name.
- A common mistake is leaving out the instance name or misspelling it.
- For SQL Server Express, a named instance is commonly used, so connecting with only the computer name may fail.
- Check whether TCP/IP is enabled.
- Open SQL Server Configuration Manager.
- Expand SQL Server Network Configuration and select the SQL Server instance.
- Make sure TCP/IP is enabled.
- If it was disabled and is changed to enabled, restart the Database Engine service for the change to take effect.
- If local connection still fails, check the SQL Server error log.
- In SSMS on the SQL Server computer, connect if possible, then go to Management > SQL Server Logs and open the current log.
- Filter for server is listening on.
- This shows the TCP port the instance is listening on.
- If the instance is using a non-default port, connect by server name and port.
- Use the format
<servername>,<portnumber>. - This is especially useful if the instance is not listening on port 1433.
- Use the format
- If the client is trying Named Pipes instead of TCP/IP, change client protocol order.
- In SQL Server Configuration Manager on the client, expand SQL Native Client <version> Configuration > Client Protocols.
- Ensure TCP/IP is enabled.
- Make sure TCP/IP has a lower order number than Named Pipes.
- Check for a bad client alias.
- In SQL Server Configuration Manager, expand SQL Server Native Client Configuration > Aliases.
- If an alias exists for the server, verify the server name and port are correct.
- An incorrect alias can redirect SSMS to the wrong target.
- If this is truly a local-only setup, firewall is usually not the first issue.
- For remote connections, firewall rules for the SQL Server port must allow traffic.
A practical first attempt for this scenario is:
- confirm the SQL Server service is running
- connect with Windows Authentication
- use
LaptopName\InstanceNameinstead of only the laptop name - if that fails, enable TCP/IP and restart SQL Server
Also note: if only SSMS was installed previously, that alone cannot host databases. SQL Server must be installed separately, which has already been done here, so the next step is confirming the running instance name and service state.
- A network-related or instance-specific error occurred while establishing a connection to SQL Server
- A network-related or instance-specific error occurred while establishing a connection to SQL Server
- A network-related or instance-specific error occurred while establishing a connection to SQL Server
- A network-related or instance-specific error occurred while establishing a connection to SQL Server
- A network-related or instance-specific error occurred while establishing a connection to SQL Server
- Error
- Error ------------------------------ A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server - Microsoft Q&A TITLE: Error