Re: How to work with triggers and relations
From: Tom Moreau (tom@dont.spam.me.cips.ca)
Date: 11/07/02
- Next message: SQL Server Development Team: "Re: Help, hacker left files that I can't delete."
- Previous message: sean: "Help, hacker left files that I can't delete."
- In reply to: Ing. Juan Manuel Alegría B.: "How to work with triggers and relations"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
From: "Tom Moreau" <tom@dont.spam.me.cips.ca> Date: Thu, 7 Nov 2002 15:38:58 -0500
Constraints get checked before triggers can fire. In SQL 7.0, there were no cascaded deletes via FK constraints, so the delete would fail and the trigger would not fire. In SQL 2K, you can change the FK constraint to use ON DELETE CASCADE, thus precluding the need for a trigger for this task. For more info on triggers and DRI, check out:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsql2k/html/sql_refintegrity.asp
-- Tom --------------------------------------------------------------- Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCT SQL Server MVP Columnist, SQL Server Professional Toronto, ON Canada www.pinnaclepublishing.com/sql "Ing. Juan Manuel Alegría B." <jmanuel@mbge.com.mx> wrote in message news:eB6pAjphCHA.1688@tkmsftngp08... Hi group. I have a question. I had been working with SQL Server 2000 and I had my relations with cascade update and delete. But I had to work with SQL Server 7.0 and I discovered that SQL 7.0 doesn't manage the update and delete cascade, so I had to make some triggers to solve that problem. But When I tried to work with the relations and triggers I had a problem. I think the problem is that the triggers can't execute itself because exists a relation. Maybe you know if exists any function or configuration to the trigger doesn't take care of the relation. . Thanks so much. -------------------------------- Atte. Ing. Juan Manuel Alegría Bobadilla jmanuel@mbge.com.mx Guadalajara, Jalisco, México
- Next message: SQL Server Development Team: "Re: Help, hacker left files that I can't delete."
- Previous message: sean: "Help, hacker left files that I can't delete."
- In reply to: Ing. Juan Manuel Alegría B.: "How to work with triggers and relations"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|