Error 18456 trying to connect Trying to connect to SQL Server (SQL Server 2008 R2) installed on Windows Server 2008 R2 results in the following error message (according to ERROLOG): 


  Error: 18456, Severity: 14, State: 38. 


Does anybody have an idea what could be the problem?
This typically means that the database specified in the connection string, in the SSMS dialog's options tab, or the user's default database is offline or otherwise not accessible (it could be restoring, single_user mode, offline, autoclose, etc).

What database are you trying to connect to? Check its status in sys.databases:

SELECT state_desc, user_access_desc, is_auto_close_on, is_in_standby
  FROM sys.databases 
  WHERE name = N'database_name';


If you are not specifying a database, then check the default database for the login:

SELECT default_database_name 
  FROM sys.server_principals
  WHERE name = N'login_name';