FIX: Trigger Does Not Return Expected Duplicate Key Insert Error to Client

Article translations Article translations
Article ID: 294311 - View products that this article applies to.
This article was previously published under Q294311
BUG #: 236053 (SHILOH_BUGS)
Expand all | Collapse all

SYMPTOMS

When all of the following conditions are true, an expected error message may not be returned to the client for a duplicate key insert failure:
  • A distributed query is used.
  • The table has a trigger.
  • The trigger contains both a SELECT statement that returns a result set and a statement such as INSERT or UPDATE.
  • Within the trigger, the INSERT or UPDATE is performed on a table with a unique key and attempts to insert a duplicate record.
The UPDATE or INSERT statement within the trigger is terminated when it tries to insert a duplicate key row in the object, but it fails to report the expected duplicate key error to the client.

RESOLUTION

To resolve this problem, obtain the latest service pack for SQL Server 2000. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:
290211 INF: How to Obtain the Latest SQL Server 2000 Service Pack

WORKAROUND

When coding in a trigger, avoid using SELECT statements which return a result set.

STATUS

Microsoft has confirmed this to be a problem in SQL Server 2000. This problem was first corrected in SQL Server 2000 Service Pack 1.

Properties

Article ID: 294311 - Last Review: November 6, 2003 - Revision: 3.2
APPLIES TO
  • Microsoft SQL Server 2000 Standard Edition
Keywords: 
kbbug kbfix kbsqlserv2000sp1fix KB294311

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com