Microsoft KB Archive/136534

From BetaArchive Wiki

FIX: INSERT Into w/ IDENTITY Col Inside Trigger Causes AV

Q136534



The information in this article applies to:


  • Microsoft SQL Server version 6.0



BUG# NT: 10242 (6.00)


SYMPTOMS

An INSERT INTO a table with an IDENTITY column inside a trigger can cause a handled access violation (AV).



CAUSE

The AV occurs only if the table with an IDENTITY column has a trigger. The trigger may be fired by either an INSERT, DELETE, or UPDATE operation. The client does not cause an AV when a SELECT INTO operation is performed on a table that is not using the IDENTITY property.



WORKAROUND

If your purpose in performing an INSERT operation inside a trigger is to implement Unique Increasing key values without using the IDENTITY property of SQL Server version 6.0, then please refer to the following article in the Microsoft Knowledge Base:


Q75164 : Implementing a Unique, Increasing Key Value


If your objective is to implement Declarative Referential Integrity (DRI), use the DRI feature of SQL Server version 6.0, or implement it by using tables without IDENTITY columns. Refer to the SQL Server "Transact-SQL Reference" manual for details on DRI implementation with triggers.



STATUS

Microsoft has confirmed this to be a problem in Microsoft SQL Server version 6.0. This problem was corrected in Service Pack 2 for SQL Server version 6.0. For more information, contact your primary support provider.


Additional query words: sql6 identity primary keys

Keywords : kbprogramming
Issue type : kbbug
Technology : kbSQLServSearch kbAudDeveloper kbSQLServ600


Last Reviewed: March 25, 2000
© 2001 Microsoft Corporation. All rights reserved. Terms of Use.