SQL Server 2008 R2 can't connect to local database in Management Studio

sql-server, sql-server-2008-r2

Solution

If your instance is called `SQLEXPRESS`, then you need to use `.\SQLEXPRESS` or `(local)\SQLEXPRESS` or `yourMachineName\SQLEXPRESS` as your server name - if you have a named instance, you need to specify that name of the instance in your server name.

Problem

I am using SQL Server 2008 R2 Express. I first installed SQL Server 2008 R2 Express Management Studio and then I installed SQL Server 2008 R2 Express. I have the instance `SQLEXPRESS` running and it is set to automatic. I am trying to connect to it locally using Windows authentication - server name is set to local and the username is grayed out and set to my profile username. When I try to connect I get the following error: Have I installed the wrong SQL Server Management Studio?

Original source