Home > Archive > SQL Anywhere Feedback > June 2005 > Enabling / Disabling triggers









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Enabling / Disabling triggers
Murray Sobol

2005-06-09, 9:23 am

I would like to see the following capability added to ASA:

Disable a trigger, and
Enable a trigger.

We commonly have a situation where the application has corrupted data
in a table which has a trigger on it. Currently, we must drop the
trigger, run a corrective script, then add the trigger again.

Other database vendors (Oracle, Microsoft SQL Server, possibly others)
support a syntax which disables/enables triggers:
Oracle example:
ALTER TRIGGER <trigger_name> DISABLE;

ALTER TRIGGER <trigger_name> ENABLE;

Microsoft Sql Server example:
ALTER TABLE <table_name> DISABLE TRIGGER
<tirgger_name>
go

ALTER TABLE <table_name> ENABLE TRIGGER <tirgger_name>
go

Murray Sobol
dbcSMARTsoftware inc.
Martin Baur

2005-06-09, 8:23 pm

In article < 74lga11st30kn88g7oto
gss21tmuqfu6lj@4ax.com>, murray_sobol@dbcsmar
tsoftware.com says...
> I would like to see the following capability added to ASA:
>
> Disable a trigger, and
> Enable a trigger.
>



I strongly support this ... because we also have some messed up table where I cannot delete SOME rows anymore, I cannot even step through the stuff using the debugger. I see no code in the debugger
that tells me why I cannot delete. So I assume it's a database corruption but dbvalidate and sa_validate do not show any problems.

Martin
Stephen Rice

2005-06-10, 8:23 pm

Murray Sobol wrote:
> I would like to see the following capability added to ASA:
>
> Disable a trigger, and
> Enable a trigger.
>
> We commonly have a situation where the application has corrupted data
> in a table which has a trigger on it. Currently, we must drop the
> trigger, run a corrective script, then add the trigger again.
>
> Other database vendors (Oracle, Microsoft SQL Server, possibly others)
> support a syntax which disables/enables triggers:
> Oracle example:
> ALTER TRIGGER <trigger_name> DISABLE;
>
> ALTER TRIGGER <trigger_name> ENABLE;
>
> Microsoft Sql Server example:
> ALTER TABLE <table_name> DISABLE TRIGGER
> <tirgger_name>
> go
>
> ALTER TABLE <table_name> ENABLE TRIGGER <tirgger_name>
> go
>
> Murray Sobol
> dbcSMARTsoftware inc.

If you are doing corrective actions (I'm assuming you do this without
users connected to the database) then could you not just globally
disable trigger firing using either -gf or FIRE_TRIGGERS=OFF?

/steve

--
Stephen Rice
Technical Services Manager
iAnywhere Solutions

--- Please Post ---
Whitepapers, Tech Docs, Solved Cases, Bug Fixes and
"Report a bug" are all available on www.ianywhere.com
Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com