2

I have an application that logs into SQL Server 2014 that uses a single login to access the database when a user opens up the application. In other words I have 6 users using the same application with different logins, but the application itself is logging into SQL server with a single login.

One of my users is having issues. When she logs into application the first time, she gets in fine, but if she tries to reopen it, it fails. If she reboots her computer, she can log in one time again. (Not acceptable)

The errors I'm seeing in the SQL Error logs are

Error 18456; Severity 14; State 38
Error 18451, Severity 14; State 1
Error 18056; Severity: 20, State 23
Error: 18456; Severity: 14 State: 23

1
  • Are you properly disposing of your connection on app close? – Dave Nov 5 '15 at 20:22
3

One location for finding out about many of these states is a post by Aaron Bertrand at:

The error you are asking about are:

Error: 18456; Severity: 14 State: 23
Access to server validation failed while revalidating the login on the connection.

Error 18456; Severity 14; State 38
Failed to open the database specified in the login properties. (or) Cannot open database "" requested by the login. The login failed.

Error 18056; Severity: 20, State 23

This is apparently related to connection pooling when the client could not reuse a spid. If this is the same problem you can look at this Microsoft Connect item, but it has been closed as "Not Reproducible."

and then:

Error 18451, Severity 14; State 1
SQL Server is in the process of shutting down. During shutdown, only members of the sysadmin fixed server role can make new connections.

This suggests that your installation needs some examination and perhaps updated to a more recent patch level.

1
  • 1
    we are at service patch 1. I'll apply the sp1 cumulative update #3. – SChrisp Nov 5 '15 at 22:49
0

Error 18456; Severity 14; State 38 Failed to open the database specified in the login properties. (or) Cannot open database "" requested by the login. The login failed.

State 38: Could not find database requested by user. Run the following command and check the result:

SELECT * from sys.databases

Depending on the results, we can identify how we need to fix the problem. For example

  1. If the database was renamed, then connect to the correct database.
  2. If the database doesn't exist, then check with your DBA to find out why your database was missing.
  3. If the database is OFFLINE, then check with your DBA to bring the database ONLINE.

Read this article: https://www.experts-exchange.com/articles/35531/How-to-Fix-SQL-Server-Login-Failed-Error-18456-State-38.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.