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)
 TRIGGERS NOT FIRING CORRECTLY

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-06-17 : 08:53:51
sue writes "Hello

We are in the process of re-architecturing (?) a SQL db which has multiple triggers on multiple tables some interacting with others..sort of explained like this...
TBLTEMPSECTION
when a new record is inserted in this table the trigger fires and copies the old section header data from the TBLSECTION - changes the details to the new semester - runs and gets the corresponding courses for the old semester copies them to TBLTEMPCOURSE and changes their semester and key to the new semester...then takes the newly changed courses and puts them in the TBLCOURSE.....this all works great.....BUT the TBLCOURSE has a trigger on its insert event which takes the values of all columns and using inserted and deleted tables updates the summary values in another table.

thats about as clear as mud!!!

what is happening is the data in the summary table is not being updated correctly.

bear in mind that it is not one course that is being inserted it could be up to 30 at one time.

when we ignore the initial trigger and simply copy and paste within TBLCourse the summary is updated correctly....but not when done with the trigger....

help is appreciated.


sue"

Page47
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2002-06-17 : 08:58:43
Maybe you are expecting this answer, but without the create table statements and the create trigger statements on the various objects mentioned, it is damn near impossible for anyone outside your organization to debug you process....

I would recommened you use sql profiler to trace the dml executed and analyze the flow to determine where you process is going evil.

<O>
Go to Top of Page
   

- Advertisement -