Geeks With Blogs
Lou Vega a thump to the brain

SQL Guru’s can skip over this posting but for the other developers who don’t have really great SQL-Fu skills, hopefully this can help out.

 

I ran into an issue today where we were having trouble with logins to a SQL 2005 database through code and it was driving me nuts because on the surface everything looked set up correctly. Part of the frustration on my part was also me still getting used to the way things look/feel inside SQL Management Studio versus the old Enterprise Manager – but that’s a whole separate rant ;)

 

Anyways the event logs on the server weren’t much help – just basically stated “Login Failure for user” (which was the same thing the exception said when it was generated) and it wasn’t until I ran across this little gem that I found the answer I was looking for in the error state message:

http://blogs.msdn.com/sql_protocols/archive/2006/02/21/536201.aspx

 

 

ERROR STATE

ERROR DESCRIPTION

2 and 5

Invalid userid

6

Attempt to use a Windows login name with SQL Authentication

7

Login disabled and password mismatch

8

Password mismatch

9

Invalid password

11 and 12

Valid login but server access failure

13

SQL Server service paused

18

Change password required

 

I actually went to the SQL Server log files in Management Studio where it gives you the “Login Failure” on one line and the EventID and Error State on the line below to find the specific reason why the login was denied and was able to correct the issue and press on.

 

So hopefully this will help others in troubleshooting login issues as well...at least then you'll know a better reason for the login failure!

 

 

Posted on Monday, February 12, 2007 7:15 PM | Back to top


Comments on this post: Troubleshooting SQL 2005 login issues

No comments posted yet.
Your comment:
 (will show your gravatar)


Copyright © Lou Vega | Powered by: GeeksWithBlogs.net