BUG: Primary Key Violation Causes AV, Text Field Involved

Last reviewed: November 4, 1997
Article ID: Q176092
The information in this article applies to:
  • Microsoft SQL Server version 6.5
BUG #: 17426 (6.5)

SYMPTOMS

On a second insert into a table that has a text field, you receive the following message:

   DB-Library Process Dead - Connection Broken

When this problem occurs, there will also be a handled access violation (AV) with a stack trace in the SQL Error Log.

A second insert into a table with the same value for the primary key may cause a handled exception that closes the client connection to the server if all of the following conditions are true:

  • The table has a text column.
  • The table has a trigger.
  • The trigger queries another table to determine the correct primary key value for the original table.
  • Another table has a foreign key reference to the original table.

WORKAROUND

The conditions described in the SYMPTOMS section of this article are really a means to create an ascending or descending key value. To work around this problem, use either of the following two more efficient ways to create an ascending or descending key value:

  • Use an IDENTITY column on the original table.

    -or-

  • Use a stored procedure that picks up the new primary key before inserting into the first table. Remove the trigger from the first table.

STATUS

Microsoft has confirmed this to be a problem in SQL Server version 6.5. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.


Additional query words: terminate terminates quits quit stop stops
Keywords : kbbug6.50 SSrvTran_SQL kbusage
Version : WINNT:6.5
Platform : winnt
Issue type : kbbug
Solution Type : kbworkaround


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: November 4, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.