Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Message

Author  Topic 

giovi2002
Starting Member

46 Posts

Posted - 2005-07-18 : 16:17:52
Goal: Delete related records in another table by using a delete trigger
Status : It works but each time I delete I get the following message
'Key column information is insufficient or incorrect. Too many rows were affected by update'
Application : access project (adp) / Sql server
What I like: to get rid of the message
What do I think: I especially redesigned the trigger to delete the indexed unique field of the related table...so..what's more?

Code of my trigger
-----------------
CREATE TRIGGER trg_deletekoppeltabel_rep_punctualiteiten ON [dbo].[REP_PUNCTUALITEITEN]
AFTER DELETE
AS

DELETE dbo.koppeltabel
Where ID IN
(Select ID
From dbo.koppeltabel INNER JOIN deleted
ON dbo.koppeltabel.repautonummer=deleted.rpautonummer)

Note: ID is an unique primary key;rpautonummer is really the name of the field in the deleted table (don't think of a mismatch as the trigger works except the nasty message)

SreenivasBora
Posting Yak Master

164 Posts

Posted - 2005-07-18 : 16:41:01
There is a similar article in Support.microsoft.com

URL: http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q268505&

This will give you an idea, why this is causing an error!!!

With Regards
BSR
Go to Top of Page

giovi2002
Starting Member

46 Posts

Posted - 2005-07-18 : 17:14:30
Thanks!!! I didn't tell but found out today that in query analyzer no probs with the code so this must be the cause.

All I need to do then is to suppress the message, do you happen to know the suppress statement in a procedure/trigger
isn't it set warnings off?
Go to Top of Page
   

- Advertisement -