Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How can I temporarily disable SQL Server trigger
Message
De
22/07/2002 21:32:02
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Titre:
How can I temporarily disable SQL Server trigger
Divers
Thread ID:
00681437
Message ID:
00681437
Vues:
62
What would be the best way to temporarily turn off the processing done by a sql server trigger, depending on the context, i.e. what code triggered it to fire. I this particular case I am working with a pre-existing database that already has the trigger code written. The trigger on the table 'sostrs' updates rows in 3 other tables. But, in the program module I added, the trigger code is not relevant to the update I am performing. (Although performing the code does not cause any problems in turns of the state of the database - the only problem is that the trigger is slowing down the execution of my code. In fact it turns out that the execution of the trigger is dramatically slowing down my update code. I discussed this in a separate thread (thread #681374).

It would be easy enough to update a column in a table created specifically for this purpose with some flag that indicates that the update code in my routine is about to run, and then change the trigger so that it just returns without doing any processing, if the flag is set, and then unsets the flag when the updates are done. But in a multiuser situation, there is the chance that others might attempt an update at the time the flag was set, and then the code that is necesssary for their case would not run.

Any suggestions on how to handle this would be appreciated.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform