SQL Server Performance

System.Data.SqlClient.SqlException: Login failed for user <UserName>. Reason: The account is disabled.

Discussion in 'SQL Server 2005 General Developer Questions' started by gopalanmani, Aug 24, 2010.

  1. gopalanmani New Member

    Hi All,
    Thank you for advance.
    I created a widows service for mail schedule with c#.net and sql server 2005 and it is working fine for past one year.

    now sometimes i am getting the "System.Data.SqlClient.SqlException: Login failed for user '<UserName>'. Reason: The account is disabled." error.


    then i restarted the windows service manually and working.


    what is the problem in my sql server connection and how to fix that issue?

  2. ashish287 New Member

    check the services configured on which account. It seems the account password is expired or account is locked.
    Check the account in Active Directory
  3. satya Moderator

    I see that 2 are different problems, are you saying that you have used C# to manage mailing schedule from SQL SErver. If so why not use database mail itself that is introduced in SQL 2005 version.
    Also what is the sevice pack on SQL Server?
    http://msdn2.microsoft.com/en-us/library/ms189828.aspx refers how to ENABLE the login, also it seems the security policy on SQL Server logins causing number of attempts will DISABLE login. See what Books ONline referred here:
    The enforcement of password policy can be configured separately for each SQL Server login. Use /msdn.microsoft.com/mshelp" />ALTER LOGIN (Transact-SQL) to configure the password policy options of a SQL Server login. The following rules apply to the configuration of password policy enforcement:
    • When CHECK_POLICY is changed to ON, the following behaviors occur:

      • CHECK_EXPIRATION is also set to ON unless it is explicitly set to OFF.

        • The password history is initialized with the value of the current password hash.
        • When CHECK_POLICY is changed to OFF, the following behaviors occur:

          • CHECK_EXPIRATION is also set to OFF.

            • The password history is cleared.

              • The value of lockout_time is reset.
  4. gopalanmani New Member

    Thank you for your response.
    I am using the same login info for web access. but i didnt get any 'Login failed' errors from web application and also after getting this error we can access the web application without any errors.

    Sql Server information

    Microsoft SQL Server Management Studio : 9.00.3042.00
    Microsoft Analysis Services Client Tools : 2005.090.3042.00
    Microsoft Data Access Components (MDAC) : 2000.086.2696.00 (srv03_sp1_qfe.060504-1600)
    Microsoft MSXML : 2.6 3.0 4.0 5.0 6.0
    Microsoft Internet Explorer : 7.0.5730.11
    Microsoft .NET Framework : 2.0.50727.1433
    Operating System : 5.2.3790

  5. satya Moderator

    From the SQL Server Management Studio (SSMS) goto Security pane and right click to create new user and confirm what are all options are ticket and not-ticked?
    Also I'm looking more information on that C# app you mentioned used as mailing.

Share This Page