SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 enable/Disable Triggers
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

CLages
Posting Yak Master

Brazil
116 Posts

Posted - 04/05/2005 :  15:31:57  Show Profile  Reply with Quote
hi, a simple big question.

I have one table Named DUPLICATA with several columns (ex 30 columns)
and i Have a Trigger in this table (Update and Delete) that Update
a Table LOGDUPLICATA
in other words each Update ou delete in DUPLICATA i Insert the old record in LOGDUPLICATA
everything works fine.

But i have 7 Diferents Programs one Update 5 columns, othes 7
columns, another one 1 column, etc

in each Program the Triggers is FIRED.

the question?

Is there a way to do something like this?

SET TRIGGERS ON
SET TRIGGERS OFF

BECAUSE IN some Programa i would not like to FIRED the trigger.

tks

C. Lages
full time NetCobol x SQL x Cristal Reports

rfrancisco
Yak Posting Veteran

USA
95 Posts

Posted - 04/05/2005 :  15:37:02  Show Profile  Visit rfrancisco's Homepage  Reply with Quote
ALTER TABLE YourTable DISABLE TRIGGER ALL
and
ALTER TABLE YourTable ENABLE TRIGGER ALL
Go to Top of Page

CLages
Posting Yak Master

Brazil
116 Posts

Posted - 04/06/2005 :  08:45:14  Show Profile  Reply with Quote
In this case none of my programs updating my Table DUPLICATA ,
will fire the Trigger.
I want that in some programs the TRIGGERS is Fired and only one Dont.

in Create Trigger HELP on BOL there are this option

IF UPDATE ( column )

the trigger will be fired only if desired Column is Updated

i am looking for IF UPDATE ( column ) DONT FIRE THE TRIGGER

This is because the table has too many columns than is easier
use the negative.

IF UPDATE ( columnX ) do nothing
otherwise i have to write

IF UPDATE ( columna , Columnb, columnc .....column80 etc )

tks
anyway
C. Lages

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000