Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

Message that SQL Server Log File Viewer shows:

Login failed for user [User]
Error: 18456, Severity: 14, State 38

What it actually means:

Failed to open the explicitly specified database

My Question:

Is there a list somewhere of all the variations of the 18456 errors (Login failed), for each combination of severity and state, with the helpful description text?

I've had a Google but can't find anything other than specific combinations.

share|improve this question
add comment

1 Answer

State codes and their meaning.

1      'Account is locked out'
2      'User id is not valid'
3-4    'Undocumented'
5      'User id is not valid'
6      'Undocumented'
7      'The login being used is disabled'
8      'Incorrect password'
9      'Invalid password'
10     'Related to a SQL login being bound to Windows domain password policy enforcement.
        See KB925744.'
11-12  'Login valid but server access failed'
16     'Login valid, but not permissioned to use the target database'
18     'Password expired'
27     'Initial database could not be found'
38     'Login valid but database unavailable (or login not permissioned)'

More detailed information is available in Aaron Bertrand's blog.

share|improve this answer
3  
A LOT more details on these states (and several more states covered) in my blog post from last year: sqlblog.com/blogs/aaron_bertrand/archive/2011/01/14/… –  Aaron Bertrand Nov 30 '12 at 17:04
    
Please mark this as the accepted answer, and consider editing Aaron's very useful link into the main body text. –  Paul White Dec 1 '12 at 3:26
    
SQL Kiwi - because it is my own answer I have to wait until 2-Dec before marking it as the accepted answer. –  Pete Oakey Dec 1 '12 at 13:23
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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