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?
If your instance is called
SQLEXPRESS
, then you need to use.\SQLEXPRESS
or(local)\SQLEXPRESS
oryourMachineName\SQLEXPRESS
as your server name - if you have a named instance, you need to specify that name of the instance in your server name.Okay so there might be various reasons behind Sql Server Management Studio's(SSMS) above behaviour:
1.It seems that if our SSMS hasn't been opened for quite some while, the OS puts it to sleep.The solution is to manually activate our SQL server as shown below:
2.The second reason could be due to incorrect credentials entered.So enter in the correct credentials.
3.If you happen to forget your credentials then follow the below steps:
NOTE: This will only work for local server and not for remote server.To connect to a remote server you need to have an I.P. address of your remote server.
Lots of the above helped for me, plus the accepted answer, but since I was on an EC2 instance, I had no idea what my instance name was. Finally, I opened SQLServer Configuration Manager and in the Name column, use whatever is there as your connection server, so in my case, .\EC2SQLEXPRESS and worked great!