Home News Helps Repair SQL Server Error Code 40143

Helps Repair SQL Server Error Code 40143

85
0

 

In case you obtain SQL Server error code 40143, these restore suggestions are value studying.

 

 

SQL Azure has a [SqlDatabaseTransientErrorDetectionStrategy.cs] class for dealing with transient errors. It covers virtually all forms of exception code that may be thought-about transient. It is usually a whole implementation of the iteration technique .

Add snippet right here for future use:

  /// /// Error codes reported by the DBNETLIB module./// Non-public ProcessNetLibErrorCode enumeration{    ZeroBytes = -3,    Expiration date = -2,    / * Finish of time. The time elapsed earlier than the operation was accomplished or earlier than the server didn't reply. * /    Unknown = -1,    Not sufficient reminiscence = 1,    AccessDenied = 2,    ConnectionBusy = 3,    ConnectionBroken = 4,    ConnectionLimit = 5,    ServerNotFound = 6,    NetworkNotFound = 7,    Inadequate assets = 8,    NetworkBusy = 9,    NetworkAccessDenied = 10,    GeneralError = 11,    IncorrectMode = 12,    NameNotFound = 13,    InvalidConnection = 14,    ReadWriteError = 15,    TooManyHandles = 16,    ServerError = 17,    SSLError = 18,    EncryptionError = 19,    EncryptionNotSupported = 20.}} 

Then a swap case to verify if the error quantity was returned within the SQL exception:

  swap (err.Quantity){    // SQL error code: 40501    // The service is at present busy. Please strive once more in 10 seconds. Code: (motive code for  decoding).    case ThrottlingCondition.ThrottlingErrorNumber:        // Decode the rationale code from the error message to find out the explanations for throttling.        var situation = ThrottlingCondition.FromError (err);        // Add decoded values ​​as further attributes to the unique SQL exception.        sqlException.Information [condition.ThrottlingMode.GetType (). Name] =            situation.ThrottlingMode.ToString ();        sqlException.Information [condition.GetType (). Name] = situation;        returns true;    // SQL error code: 10928    // useful resource ID:% d. Database restrict% s is% d and has been reached.    Case 10928:    // SQL error code: 10929    // useful resource ID:% d. % S minimal assure is% d, most restrict is% d, and present database utilization is% d.    // Nonetheless, the server is at present too busy to help requests bigger than% d for this database.    Case 10929:    // SQL error code: 10053    // Transport layer error whereas receiving outcomes from server.    // A longtime connection was canceled by the software program in your host pc.    Case 10053:    // SQL error code: 10054    // Transport error when sending a request to the server.    // (Supplier: TCP supplier, error: 0 - existingThe outgoing connection was forcibly closed by the distant host.)    Case 10054:    // SQL error code: 10060    // An error associated to the community or particular occasion when connecting to SQL Server.    // Server can't be discovered or just isn't out there. Be certain the occasion title is right and that SQL Server    // configured to permit distant connections. (Supplier: TCP Supplier, Error: 0 - The connection try failed.    // as a result of the linked participant didn't reply accurately after a sure time, or the connection failed    // as a result of the linked host did not reply.) "}    Case 10060:    // SQL error code: 40197    // The service encountered an error whereas processing your request. Attempt once more.    Case 40197:    // SQL error code: 40540    // The service encountered an error whereas processing your request. Attempt once more.    Case 40540:    // SQL error code: 40613    // Database XXXX on server YYYY is at present unavailable. Please strive once more later. If the issue persists, contact the shopper.    // keep and provides them the session monitoring id ZZZZZ.    Case 40613:    // SQL error code: 40143    // Discovery serviceThere was an error in processing your request. Attempt once more.    Case 40143:    // SQL error code: 233    // The consumer can't join attributable to an error in the course of the connection initialization course of earlier than connecting.    // Attainable causes: The consumer tried to connect with an unsupported model of SQL Server. The server was too busy    // settle for new connections; or the server has a restricted useful resource (not sufficient reminiscence or the utmost variety of connections allowed).    // (Supplier: TCP Supplier, Error: 0 - An current connection was forcibly closed by the distant host.)    Case 233:    // SQL error code: 64    // The connection to the server was profitable, however an error occurred in the course of the connection course of.    // (Supplier: TCP Supplier, Error: 0 - The desired community title is now not out there.)    Case 64:    // DBNETLIB error code: 20    // The occasion of SQL Server you had been making an attempt to connect with doesn't help encryption.    case (integer) ProcessNetLibErrorCode.EncryptionNotSupported:        returns true;}} 

The whole supply code may be discovered right here.

Error 40549: Session Ended Due To Lengthy-running Transaction

40549: session ended, searchAs lengthy as you could have an extended transaction. Attempt to shorten the transaction.

If this error persists, strive the next to resolve the problem:

  1. Within the sys.dm_exec_requests view, verify for any open periods which have a excessive worth for the total_elapsed_time column. Carry out this verify by working the next SQL script:

      SELECT * FROM dm_exec_requests 
  2. Outline an enter buffer for an extended request.

  3. Optimize your question.

Additionally remember so as to add queries. For extra info on stack overlays, see Utilizing Stacking to Enhance SQL Database Utility Efficiency .

sql server error code 40143

For troubleshooting particulars, see Is my question working accurately within the cloud? .

Supply Code Of The EntLib60 IsTransient Technique

Then, within the SqlDatabaseTransientErrorDetectionStrategy class, present the C # supply code for the IsTransient methodology. The supply code makes it clear which bugs had been thought-about momentary in April 2013 and ought to be tried once more.

  public bool IsTransient (ex exception){  if (for instance!= zero)  {    SqlException sqlException;    if ((sqlException = ex as SqlException)! = null)    {      // Record of all errors discovered within the exception.      foreach (SqlError in sqlException.Errors)      {        Swap (error quantity)        {            // SQL error code: 40501            // The service is at present busy. Please strive once more in 10 seconds.            // Code: (motive code for decoding).          case ThrottlingCondition.ThrottlingErrorNumber:            // Decode the error message motive code            // Decide the explanations for the restriction.            var situation = ThrottlingCondition.FromError (err);            // Add decoded values ​​as further attributes            // unique SQL exception.            sqlException.Information [condition.ThrottlingMode.GetType (). Name] =              situation.ThrottlingMode.ToString ();            sqlException.Information [condition.GetType (). Name] = situation;            returns true;          Case 10928:          Case 10929:          Case 10053:          Case 10054:          Case 10060:          Case 40197:          Case 40540:          Case 40613:          Case 40143:          Case 233:          Case 64:            // DBNETLIB error code: 20            // The SQL Server occasion you need to connect with            // doesn't help encryption.          case (integer) ProcessNetLibErrorCode.EncryptionNotSupported:            returns true;}}      }}    }}    in any other case, if (e.g. TimeoutException)    {      returns true;    }}    Others    {      EntityException entityException;      if ((entityException = ex as EntityException)! = null)      {        returns this.IsTransient (entityException.InnerException);      }}    }}  }}  false return;}}