FIX: Trigger May Not Fire if Query Plan Uses CONSTANT SCAN Operator

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

SYMPTOMS

A trigger may not fire if the query does not modify any rows and the execution plan contains the CONSTANT SCAN operator.

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

STATUS

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

MORE INFORMATION

The following code demonstrates the problem:
create table table_xyz 
(
col_a int constraint cst_name check(col_a < 100)
)
go
create clustered index myidx on table_xyz(col_a)
go
create trigger trig_upd on table_xyz for update as
print '(Trigger): Update trigger fired'
go

set nocount on

-- This update will fire the trigger.
print 'This will fire trigger'
update table_xyz set col_a=1 where col_a > 32767
go
print ''
-- This update will not fire the trigger.
print 'This will not fire trigger'
update table_xyz set col_a=1 where col_a > 32768
go
				
The last update query uses a CONSTANT SCAN operator; the SHOWPLAN for this query is as follows:
StmtText
-------------------
  |--Constant Scan
				

Properties

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

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