Wednesday, June 13, 2012

Remote connections to SQL Express

I can connect to my SQL Express server from Management Studio while remoted onto the server, but couldn’t connect to it from my workstation from Management Studio. This is v 10.5.1600.1, which is SQL Server 2008 R2.

I confirmed all the steps in the following post: http://blogs.msdn.com/b/sqlexpress/archive/2005/05/05/415084.aspx

I confirmed that it wasn’t a SQL permissions thing, because I’m using the same credentials I used when connecting on the server.

Still no luck. Connecting to servername\sqlexpress fails with:

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 is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) (Microsoft SQL Server, Error: -1)

On a whim, I tried connecting to just the servername without the instance name. Success. It looks like SQL Express thinks it is the default instance. I don’t know how it was installed. Maybe this was intentional.

I did also set it to respond to the default SQL Server port (1433) mainly because, when following the instructions in the blog post linked above, I couldn’t think of another port number to use so just borrowed the standard one (there’s no other SQL instance on the server).

If I am logged on to the server via remote desktop, I can connect to either servername or servername\sqlexpress. From my workstation only servername works.

TL;DR: Try connecting to the default instance if your named instance won’t respond, just because it might work anyway.

No comments: