Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trigger works in EM,QA,Adodb but not in access

Status
Not open for further replies.

PWise

Programmer
Dec 12, 2002
2,633
US
This is mt table Structure
[StudentIEPID] [int] IDENTITY (1, 1) NOT NULL ,
[StudentID] [int] NULL ,
[CurrentIEP] [bit] NULL ,
[IEPDate] [datetime] NULL

My goal is to insure that each student has only one current IEP.

This my trigger
Code:
ALTER TRIGGER SetCurrentIEP
ON StudentIEPs
FOR INSERT, UPDATE 
AS 

If UPDATE(CurrentIEP)OR UPDATE(studentid)

BEGIN

Update StudentIEPs set CurrentIEP=0
from StudentIEPs
inner join inserted on inserted.studentid=StudentIEPs.studentid and inserted.StudentIEPID<>StudentIEPs.StudentIEPID 
and inserted.CurrentIEP=1

END

This works fine in EM,QA,Adodb

But in Access Adp i get this error

Key column informaion is insufficient or incorrect. Too many rows were affected by update

Any Ideas

Thank You
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top