I installed SQL Server 2008 R2 Express Edition.
I opened the command prompt and typed sqlcmd -S server1\SQLExpress -U SqlUserAccount -P SqlPassword
to connect to SQL Server.
However, it occasionally shows error messages such as 'login failed for user', or 'could not open a connection to SQL server'. When I install SQL Server 2008 R2 with Advanced Services, I can logon to SQL Server using SSMS successfully.
Best Answer
SQL Server Express greatly reduces the resources it uses if it is idle for a period of time. This may cause connections to time-out if the machine is busy after SQL Server idles.
http://blogs.msdn.com/b/sqlexpress/archive/2008/02/22/sql-express-behaviors-idle-time-resources-usage-auto-close-and-user-instances.aspx contains some details about this behavior, including:
Also, SQL Server Express will "auto-close" any database that is no longer being used 300 milliseconds after activity ceases.