sábado, 6 de outubro de 2012

SQLServer Cannot connect to server

When you get the Cannot connect to , many things can be involved, but here is one which is related to a named instance. If you choose to install a named instance you must inform to SQL Server the instance you want to use. It would list them by design, but does not. So, you must remember to inform the name you gave it. See the previous post about Express instance issues for more details.

TITLE: Connect to Server

Cannot connect to (local).
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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 2)

Express named instance issues

If you have just installed an instance of SQL Server Express, and used a Named instance instead of a Default instance, so you must remember that it will be mandatory to inform the instance name right after the Server name field when loggin in (see picture below), or in another situation, like creating a database via script. The path to the database changes from MSSQLSERVER to SQLEXPRESS.

Using a named instance, instead of default bring some little bit differences when using SQLServer