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)
 the record that is been affected and causes firing a trigger

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2006-10-13 : 07:20:29
netman writes "hi

I know that the subject of my question is a little ambiguous but let me explain my case and then you can understand my problem.

well we have a database with some tables that in each table we have some triggers I mean in one table we have 2 triggers that is sensitive by updating of a field for example for table t1 we have fields (a,b,c,d)

trigger1 is sensitive on updating in field (a) and trigger2 is sensitive on updating field (d)

in the body of trigger we have to make changes on that record that recently caused the trigger fired for example in the boddy of trigger we have to have :

b=a and c=a and d=1

if I am not wrong in mySQL we can write :

UPDATE t1 SET b=NEW.a

or for some circumstances (depends on the problem) :

UPDATE t1 SET b =OLD.a

I found a way in sql server like IDENTITY but it causes our tables get larger so would you please help me to find a suitable way to solve my problem.

if there is not another way I have to use the IDENTITY way

thanks for your attention
Best regards.

netman"

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-10-13 : 07:26:47
Use built-in INSERTED and DELETED special tables.


Peter Larsson
Helsingborg, Sweden
Go to Top of Page
   

- Advertisement -